feat: add tray control, priority restoration and session logging
This commit is contained in:
1 parent
4f8f6218ad
commit
4880aa46dc
25 files changed
+3072
-676
No files matched your search
@@ -0,0 +1,43 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"image/png"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTrayMouseButtonsAndKeyboard(t *testing.T) {
|
||||
for _, event := range []uint32{0x400, 0x401, 0x7b, 0x208, 0x20c} {
|
||||
if !trayActivation(true, event) {
|
||||
t.Fatalf("version 4 activation missing: %#x", event)
|
||||
}
|
||||
}
|
||||
for _, event := range []uint32{0x202, 0x205, 0x208, 0x20c} {
|
||||
if !trayActivation(false, event) {
|
||||
t.Fatalf("legacy activation missing: %#x", event)
|
||||
}
|
||||
}
|
||||
for _, event := range []uint32{0x202, 0x205, 0x200, 0} {
|
||||
if trayActivation(true, event) {
|
||||
t.Fatalf("duplicate or spurious version 4 activation: %#x", event)
|
||||
}
|
||||
}
|
||||
}
|
||||
func TestEmbeddedOfficialSilkAssets(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
data []byte
|
||||
hash string
|
||||
}{{trayPNG, "f52dca6b882152f3a4f2459ea8a02a75a6d925bf18082cae31bb0ecc254fb9eb"}, {exitPNG, "d04ecfc93ff86c44f6fc39e35945e3d8a7648ba8fcd97a2635920df2e88893b3"}} {
|
||||
if fmt.Sprintf("%x", sha256.Sum256(test.data)) != test.hash {
|
||||
t.Fatal("asset differs from pinned official repository")
|
||||
}
|
||||
config, err := png.DecodeConfig(bytes.NewReader(test.data))
|
||||
if err != nil || config.Width != 16 || config.Height != 16 {
|
||||
t.Fatal("invalid Silk image", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user