From 578dc80038ba8a75b52bf886ed40e7b63907371b Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Fri, 23 Feb 2024 11:27:18 +0200 Subject: [PATCH] Fix the wrong styte of waiting EventWatcher's promise 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. --- device-posture/device-posture.https.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/device-posture/device-posture.https.html b/device-posture/device-posture.https.html index f84317c19bf6f8..72b8d76a9519a9 100644 --- a/device-posture/device-posture.https.html +++ b/device-posture/device-posture.https.html @@ -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.');