Bug 1720205 [wpt PR 29641] - bluetooth: Mark requestDevice/cross-origin-iframe.sub.https.html flaky, a=testonly
☠☠ backed out by dec0a179f851 ☠ ☠
authorReilly Grant <reillyg@chromium.org>
Sat, 17 Jul 2021 09:49:45 +0000
changeset 585840 af8a7029fc6dbdb849ae96d68613bb998af5bfa0
parent 585839 017c2bcbb73bb16c3d34952594abbd2693603536
child 585841 28740237737878b9ebe5b9994821133c998a0cab
push id146460
push userwptsync@mozilla.com
push dateSat, 17 Jul 2021 19:39:03 +0000
treeherderautoland@818df272f6e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1720205, 29641, 1066891, 1227710, 3021754, 900759
milestone92.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1720205 [wpt PR 29641] - bluetooth: Mark requestDevice/cross-origin-iframe.sub.https.html flaky, a=testonly Automatic update from web-platform-tests bluetooth: Mark requestDevice/cross-origin-iframe.sub.https.html flaky This change fixes up requestDevice/cross-origin-iframe.sub.https.html so that it will fail rather than time out when the iframe reports an unexpected response and marks the test flaky until issue 1066891 is resolved. Bug: 1227710 Change-Id: Iec2082dd617caff39c9b424ff856cf875379ecda Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3021754 Commit-Queue: Reilly Grant <reillyg@chromium.org> Auto-Submit: Reilly Grant <reillyg@chromium.org> Reviewed-by: Chris Mumford <cmumford@google.com> Cr-Commit-Position: refs/heads/master@{#900759} -- wpt-commits: aac96012eda81520a0bbf5cb37d0d058ebfbe291 wpt-pr: 29641
testing/web-platform/tests/bluetooth/requestDevice/cross-origin-iframe.sub.https.html
--- a/testing/web-platform/tests/bluetooth/requestDevice/cross-origin-iframe.sub.https.html
+++ b/testing/web-platform/tests/bluetooth/requestDevice/cross-origin-iframe.sub.https.html
@@ -9,32 +9,27 @@
 <script>
 'use strict';
 const test_desc = 'Request device from a unique origin. ' +
     'Should reject with SecurityError.';
 const cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
     '/bluetooth/resources/health-thermometer-iframe.html'
 let iframe = document.createElement('iframe');
 
-bluetooth_test(
-    () => setUpHealthThermometerDevice()
-              // 1. Load the iframe.
-              .then(() => new Promise(resolve => {
-                      iframe.src = cross_origin_src;
-                      document.body.appendChild(iframe);
-                      iframe.addEventListener('load', resolve);
-                    }))
-              // 2. Request the device from the iframe.
-              .then(() => new Promise(resolve => {
-                      iframe.contentWindow.postMessage(
-                          {type: 'RequestDevice'}, '*');
+bluetooth_test(async (t) => {
+    await setUpHealthThermometerDevice();
+
+    // 1. Load the iframe.
+    const iframeWatcher = new EventWatcher(t, iframe, ['load']);
+    iframe.src = cross_origin_src;
+    document.body.appendChild(iframe);
+    await iframeWatcher.wait_for('load');
 
-                      window.onmessage = messageEvent => {
-                        assert_equals(
-                            messageEvent.data,
-                            'SecurityError: requestDevice() ' +
-                                'called from cross-origin iframe.');
-                        resolve();
-                      }
-                    })),
-    test_desc);
+    // 2. Request the device from the iframe.
+    const windowWatcher = new EventWatcher(t, window, ['message']);
+    iframe.contentWindow.postMessage({type: 'RequestDevice'}, '*');
+    const messageEvent = await windowWatcher.wait_for('message');
+    assert_equals(
+        messageEvent.data,
+        'SecurityError: requestDevice() called from cross-origin iframe.');
+}, test_desc);
 </script>
 </body>