2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
4 <script src=
"resources/bluetooth-helpers.js"></script>
12 let readiesReceived
= 0;
13 window
.onmessage
= messageEvent
=> test
.step(() => {
14 if (messageEvent
.data
=== 'Ready') {
17 if (readiesReceived
< numIframes
) {
21 let iframesFinished
= 0;
22 window
.onmessage
= messageEvent
=> test
.step(() => {
23 if (messageEvent
.data
!== 'Success') {
24 console
.error(messageEvent
.data
);
27 if (iframesFinished
=== numIframes
) {
32 Array
.prototype.forEach
.call(document
.querySelectorAll('iframe'), iframe
=> {
33 callWithKeyDown(() => {
34 iframe
.contentWindow
.postMessage('Go', '*');
39 testRunner
.setBluetoothMockDataSet('GenericAccessAdapter');
40 for (let i
= 0; i
< numIframes
; i
++) {
41 let iframe
= document
.createElement('iframe');
42 iframe
.src
= 'resources/requestDevice-in-iframe.html';
43 document
.body
.appendChild(iframe
);
45 }, 'Concurrent requestDevice calls in iframes work.');