mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
test(ioscompanion): cover pasteboard grant on launch, drop warm-up tests
This commit is contained in:
1 parent
a0cc3b5d05
commit
8b7a51c5b5
2 files changed
+26
-27
No files matched your search
@@ -386,33 +386,6 @@ func TestEraseTextZeroIsNoOp(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWarmUpPasteHandlesDialog(t *testing.T) {
|
||||
dialog := string(loadDialogDump(t))
|
||||
fake := &fakeRunner{dumps: [][]byte{[]byte(dialog)}}
|
||||
if err := warmUpPaste(context.Background(), fake); err != nil {
|
||||
t.Fatalf("warmUpPaste: %v", err)
|
||||
}
|
||||
if fake.pasteboard != warmUpPrimer {
|
||||
t.Fatalf("pasteboard: got %q, want %q", fake.pasteboard, warmUpPrimer)
|
||||
}
|
||||
// Streams: paste chord, tap allow.
|
||||
if len(fake.hidStreams) != 2 {
|
||||
t.Fatalf("expected 2 HID streams, got %d", len(fake.hidStreams))
|
||||
}
|
||||
eventsEqual(t, fake.hidStreams[0], pasteChordEvents())
|
||||
eventsEqual(t, fake.hidStreams[1], tapEvents(280, 465))
|
||||
}
|
||||
|
||||
func TestWarmUpPasteNoDialog(t *testing.T) {
|
||||
fake := &fakeRunner{dumps: [][]byte{[]byte(`[]`)}}
|
||||
if err := warmUpPaste(context.Background(), fake); err != nil {
|
||||
t.Fatalf("warmUpPaste: %v", err)
|
||||
}
|
||||
if len(fake.hidStreams) != 1 {
|
||||
t.Fatalf("expected only the paste chord, got %d streams", len(fake.hidStreams))
|
||||
}
|
||||
}
|
||||
|
||||
func TestUsesPasteboard(t *testing.T) {
|
||||
cases := []struct {
|
||||
text string
|
||||
|
||||
Reference in new issue
Block a user