From 291385c15ed5cf39ad5a37182bcc1994ee799744 Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Tue, 9 Apr 2024 09:31:57 +0300 Subject: [PATCH] Fix wrong event type 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. --- device-posture/device-posture-change-event.https.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/device-posture/device-posture-change-event.https.html b/device-posture/device-posture-change-event.https.html index ab0ee6805a183c..6524b6796a705c 100644 --- a/device-posture/device-posture-change-event.https.html +++ b/device-posture/device-posture-change-event.https.html @@ -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.');