mirror of
https://github.com/jetkvm/kvm.git
synced 2026-05-21 05:20:35 +00:00
fix(test): use relative mouse wake for S3 suspend (#1402)
Use relative mouse reports for the S3 wake e2e path because absolute mouse movement is not a reliable wake source on some hosts. This keeps the test aligned with a wake path that passes against the current JetKVM and remote host setup.
This commit is contained in:
@@ -2389,8 +2389,12 @@ test.describe("Remote Host Agent", () => {
|
||||
await new Promise(r => setTimeout(r, 10000));
|
||||
expect(await agent!.health(), "Host should be asleep after 10s").toBe(false);
|
||||
|
||||
// Wake via mouse movement
|
||||
await sendAbsMouseMove(sharedPage, 16384, 16384);
|
||||
// Wake via relative mouse activity. This exercises the boot-style mouse HID
|
||||
// interface, which is typically a more reliable suspend wake source than
|
||||
// the absolute mouse reports used during normal pointer sync.
|
||||
await callJsonRpc(sharedPage, "relMouseReport", { dx: 8, dy: 0, buttons: 0 });
|
||||
await callJsonRpc(sharedPage, "relMouseReport", { dx: 0, dy: 0, buttons: 1 });
|
||||
await callJsonRpc(sharedPage, "relMouseReport", { dx: 0, dy: 0, buttons: 0 });
|
||||
|
||||
const wakeDeadline = Date.now() + 30000;
|
||||
let hostUp = false;
|
||||
@@ -2400,11 +2404,13 @@ test.describe("Remote Host Agent", () => {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
await sendAbsMouseMove(
|
||||
sharedPage,
|
||||
100 + Math.random() * 32000,
|
||||
100 + Math.random() * 32000,
|
||||
);
|
||||
await callJsonRpc(sharedPage, "relMouseReport", {
|
||||
dx: Math.random() > 0.5 ? 12 : -12,
|
||||
dy: Math.random() > 0.5 ? 6 : -6,
|
||||
buttons: 0,
|
||||
});
|
||||
await callJsonRpc(sharedPage, "relMouseReport", { dx: 0, dy: 0, buttons: 1 });
|
||||
await callJsonRpc(sharedPage, "relMouseReport", { dx: 0, dy: 0, buttons: 0 });
|
||||
} catch {
|
||||
/* best effort */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user