fix(windows): accept successful tray readiness HRESULTs
This commit is contained in:
1 parent
ae5e979761
commit
0735908ca9
7 files changed
+71
-2
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package windowstray
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestTrayReadinessAcceptsSuccessfulHRESULT_BH_WINTRAY_06(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
result uintptr
|
||||
ready bool
|
||||
}{
|
||||
{"S_OK", 0, true},
|
||||
{"S_FALSE with registered icon", 1, true},
|
||||
{"other successful HRESULT", 0x00040000, true},
|
||||
{"E_FAIL", 0x80004005, false},
|
||||
{"E_INVALIDARG", 0x80070057, false},
|
||||
{"E_ACCESSDENIED", 0x80070005, false},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
if got := iconQuerySucceeded(tc.result); got != tc.ready {
|
||||
t.Fatalf("HRESULT %#x: ready=%v, want %v", tc.result, got, tc.ready)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user