OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script> | 4 <script src="../../resources/bluetooth/bluetooth-helpers.js"></script> |
| 5 <script src="../../resources/bluetooth/web-bluetooth-test.js"></script> |
| 6 <script src="../../resources/mojo-helpers.js"></script> |
5 <body> | 7 <body> |
6 <script> | 8 <script> |
7 "use strict"; | 9 "use strict"; |
8 | 10 |
9 const numIframes = 5; | 11 const numIframes = 5; |
10 | 12 |
11 async_test(test => { | 13 async_test(test => { |
12 let readiesReceived = 0; | 14 let readiesReceived = 0; |
13 window.onmessage = messageEvent => test.step(() => { | 15 window.onmessage = messageEvent => test.step(() => { |
14 if (messageEvent.data === 'Ready') { | 16 if (messageEvent.data === 'Ready') { |
(...skipping 14 matching lines...) Expand all Loading... |
29 } | 31 } |
30 }); | 32 }); |
31 | 33 |
32 Array.prototype.forEach.call(document.querySelectorAll('iframe'), iframe =
> { | 34 Array.prototype.forEach.call(document.querySelectorAll('iframe'), iframe =
> { |
33 callWithKeyDown(() => { | 35 callWithKeyDown(() => { |
34 iframe.contentWindow.postMessage('Go', '*'); | 36 iframe.contentWindow.postMessage('Go', '*'); |
35 }); | 37 }); |
36 }); | 38 }); |
37 }); | 39 }); |
38 | 40 |
39 return setBluetoothFakeAdapter('HeartRateAdapter') | 41 return setUpHealthThermometerAndHeartRateDevices() |
40 .then(() => { | 42 .then(() => { |
41 for (let i = 0; i < numIframes; i++) { | 43 for (let i = 0; i < numIframes; i++) { |
42 let iframe = document.createElement('iframe'); | 44 let iframe = document.createElement('iframe'); |
43 iframe.src = '../../resources/bluetooth/requestDevice-in-iframe.html'; | 45 iframe.src = '../../resources/bluetooth/requestDevice-in-iframe.html'; |
44 document.body.appendChild(iframe); | 46 document.body.appendChild(iframe); |
45 } | 47 } |
46 }); | 48 }); |
47 }, 'Concurrent requestDevice calls in iframes work.'); | 49 }, 'Concurrent requestDevice calls in iframes work.'); |
48 </script> | 50 </script> |
49 </body> | 51 </body> |
OLD | NEW |