diff options
Diffstat (limited to 'test/macos_e2e.swift')
| -rw-r--r-- | test/macos_e2e.swift | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/macos_e2e.swift b/test/macos_e2e.swift index ba0c48f0..42bc8229 100644 --- a/test/macos_e2e.swift +++ b/test/macos_e2e.swift @@ -609,12 +609,45 @@ private final class Driver: PardesViewDelegate { view.click(Trackpad.forceClickButton, at: cell) pump() + // `rotate <degrees> [gap_ms]`. The optional gap is a real sleep BEFORE + // the event, and it is the only way a script can say how FAST the dial + // is being turned: libpardes measures the release speed off the + // monotonic clock between events, so back-to-back script calls read as + // an impossibly hard flick. Pace them and a slow twist is genuinely + // slow — which is the half of the momentum contract worth asserting, + // because "no fling" is not something a fling test can show. case "rotate": let view = try live() let degrees = try double(args, 0, "rotate degrees") + if args.count > 1 { + Thread.sleep(forTimeInterval: try double(args, 1, "rotate gap_ms") / 1000) + } view.rotate(degrees: CGFloat(degrees)) pump() + // The fingers coming off. Its own command because the fling is decided + // by the RELEASE SPEED, and a script that could only turn the dial + // could never throw it — NSEvent phases have no public constructor, so + // this entry point is the only way the momentum path is reachable at + // all. The coast is then spent by the pump, at one fixed step per tick. + case "rotate_end": + let view = try live() + view.rotateEnd() + pump() + + // `drop <path> <col> <row>`: a file dropped ON the grid at that cell. + // Same reason as the two above — `NSDraggingInfo` is a protocol with a + // dozen members and no public conformer, so the entry point below the + // event is the only honest way in. What it must prove is the WHERE: a + // drop is a click plus Look, so the document lands beside the pane + // pointed at rather than beside whichever one had focus. + case "drop": + let view = try live() + let path = try token(args, 0, "drop path") + let cell = try gridPoint(args, 1, "drop") + view.drop([path], at: cell) + pump() + case "scroll": let view = try live() let rows = try double(args, 0, "scroll rows") |
