Skip to content

Commit

Permalink
Fix the wrong styte of waiting EventWatcher's promise
Browse files Browse the repository at this point in the history
EventWatcher promise was waited with mixed style. Code was fixed to use
only one style of waiting. After change EventWatcher eventTypes
parameter value needed to change also to able to run test correctly.
  • Loading branch information
JuhaVainio committed Feb 23, 2024
1 parent 1b0487d commit 578dc80
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions device-posture/device-posture.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@

// 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
device_posture_test(async (t) => {
const watcher = new EventWatcher(t, navigator.devicePosture, ['change']);
const watcher = new EventWatcher(t, navigator.devicePosture, ['onchange']);
const postures = ['folded', 'continuous', 'folded'];
for (const posture of postures) {
await test_driver.set_device_posture(posture);
await watcher.wait_for('change').then(() => {
assert_equals(posture, navigator.devicePosture.type);
});
await watcher;
assert_equals(posture, navigator.devicePosture.type);
}
}, 'Device posture test: device-posture-change-event.js.');

Expand Down

0 comments on commit 578dc80

Please sign in to comment.