Commit d80b3e1
feat: Add system sleep/wake observers and a restart mechanism to rein… (#44)
* feat: Add system sleep/wake observers and a restart mechanism to reinitialize multitouch monitoring.
* feat: improve MultitouchManager restart logic to reset gesture state with new tests.
* fix: restart() and start() methods
* fix: restart() guard condition to allow retry after failed wake
The restart() method's guard condition previously checked isMonitoring,
which would fail if a previous restart attempt had failed (since
internalStop() sets isMonitoring=false before setupEventTap() runs).
Changed guard to check wakeObserver OR isMonitoring, allowing restart
attempts as long as start() was called and stop() hasn't been called.
Also added injectable eventTapSetup factory parameter to init for
testing purposes, following the existing TouchDeviceProviding pattern.
This allows tests to mock event tap creation which requires
accessibility permissions unavailable in test environments.
* test: update tests to use injected mock event tap
Updated all MultitouchManager test instantiations to inject
eventTapSetup: { true } mock, allowing tests to pass without
requiring accessibility permissions for CGEvent.tapCreate().
This follows the existing MockDeviceMonitor pattern and fixes
38 failing tests that couldn't run in CI/test environments.
* test: add mock event tap to MenuBarControllerTests
Updated MenuBarControllerTests to inject eventTapSetup: { true } in
setUp() and testControllerWithNilManagerState(), fixing test failures
in CI environments without accessibility permissions.1 parent 2c4bbc7 commit d80b3e1
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
428 | | - | |
| 428 | + | |
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| |||
0 commit comments