Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: LayoutTests/bluetooth/iframeRequestDevice.html

Issue 1227863007: Test that concurrent requestDevice() calls from iframes work. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@attach-to-frame
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/bluetooth/resources/requestDevice-in-iframe.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharness-helpers.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="bluetooth-helpers.js"></script>
6 <body>
7 <script>
8 "use strict";
9
10 const numIframes = 5;
11
12 async_test(test => {
13 let readiesReceived = 0;
14 window.onmessage = messageEvent => test.step(() => {
15 if (messageEvent.data === 'Ready') {
16 readiesReceived++;
17 }
18 if (readiesReceived < numIframes) {
19 return;
20 }
21
22 let iframesFinished = 0;
23 window.onmessage = messageEvent => test.step(() => {
24 if (messageEvent.data !== 'Success') {
25 console.error(messageEvent.data);
26 }
27 iframesFinished++;
28 if (iframesFinished === numIframes) {
29 test.done();
30 }
31 });
32
33 Array.prototype.forEach.call(document.querySelectorAll('iframe'), iframe = > {
34 callWithKeyDown(() => {
35 iframe.contentWindow.postMessage('Go', '*');
36 });
37 });
38 });
39
40 testRunner.setBluetoothMockDataSet('SingleEmptyDeviceAdapter');
41 for (let i = 0; i < numIframes; i++) {
42 let iframe = document.createElement('iframe');
43 iframe.src = 'resources/requestDevice-in-iframe.html';
44 document.body.appendChild(iframe);
45 }
46 }, 'Concurrent requestDevice calls in iframes work.');
47 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/bluetooth/resources/requestDevice-in-iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698