Skip to content

Commit

Permalink
Fix wrong event type
Browse files Browse the repository at this point in the history
Event type was changed from 'onchange' to 'change'. This led change in
waiting for event. Which solved the problem that 'continuous' posture
had to be the first posture.
  • Loading branch information
JuhaVainio committed Apr 9, 2024
1 parent 63289d9 commit 291385c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions device-posture/device-posture-change-event.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

// REFERENCE https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/http/tests/inspector-protocol/device-posture/device-posture-change-event.js
promise_test(async (t) => {
const watcher = new EventWatcher(t, navigator.devicePosture, ['onchange']);
const postures = ['continuous', 'folded', 'continuous', 'folded'];
const watcher = new EventWatcher(t, navigator.devicePosture, ['change']);
const postures = ['folded', 'continuous', 'folded'];
for (const posture of postures) {
await test_driver.set_device_posture(posture);
await watcher;
await Promise.all([
watcher.wait_for('change'),
test_driver.set_device_posture(posture)
]);
assert_equals(posture, navigator.devicePosture.type);
}
}, 'Device posture test: device-posture-change-event.js.');
Expand Down

0 comments on commit 291385c

Please sign in to comment.