Skip to content

Commit

Permalink
Add waiting of change when setting or clearing device posture in clea…
Browse files Browse the repository at this point in the history
…r test
  • Loading branch information
JuhaVainio committed Apr 9, 2024
1 parent cb93f7e commit f09d788
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions device-posture/device-posture-clear.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@
const originalPosture = navigator.devicePosture.type;
const posture = originalPosture ? 'folded' : 'continuous';

await test_driver.set_device_posture(posture);
const watcher = new EventWatcher(t, navigator.devicePosture, ['change']);
await Promise.all([
watcher.wait_for('change'),
test_driver.set_device_posture(posture)
]);
assert_equals(navigator.devicePosture.type, posture);

await test_driver.clear_device_posture();
await Promise.all([
watcher.wait_for('change'),
test_driver.clear_device_posture()
]);
assert_equals(navigator.devicePosture.type, originalPosture);
}, 'Tests that device posture override can be removed.');

</script>

0 comments on commit f09d788

Please sign in to comment.