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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/bluetooth/resources/requestDevice-in-iframe.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/bluetooth/iframeRequestDevice.html
diff --git a/LayoutTests/bluetooth/iframeRequestDevice.html b/LayoutTests/bluetooth/iframeRequestDevice.html
new file mode 100644
index 0000000000000000000000000000000000000000..90f1ceafa9e3701cdcfcb337b3470efa175d0df4
--- /dev/null
+++ b/LayoutTests/bluetooth/iframeRequestDevice.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharness-helpers.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="bluetooth-helpers.js"></script>
+<body>
+<script>
+ "use strict";
+
+ const numIframes = 5;
+
+ async_test(test => {
+ let readiesReceived = 0;
+ window.onmessage = messageEvent => test.step(() => {
+ if (messageEvent.data === 'Ready') {
+ readiesReceived++;
+ }
+ if (readiesReceived < numIframes) {
+ return;
+ }
+
+ let iframesFinished = 0;
+ window.onmessage = messageEvent => test.step(() => {
+ if (messageEvent.data !== 'Success') {
+ console.error(messageEvent.data);
+ }
+ iframesFinished++;
+ if (iframesFinished === numIframes) {
+ test.done();
+ }
+ });
+
+ Array.prototype.forEach.call(document.querySelectorAll('iframe'), iframe => {
+ callWithKeyDown(() => {
+ iframe.contentWindow.postMessage('Go', '*');
+ });
+ });
+ });
+
+ testRunner.setBluetoothMockDataSet('SingleEmptyDeviceAdapter');
+ for (let i = 0; i < numIframes; i++) {
+ let iframe = document.createElement('iframe');
+ iframe.src = 'resources/requestDevice-in-iframe.html';
+ document.body.appendChild(iframe);
+ }
+ }, 'Concurrent requestDevice calls in iframes work.');
+</script>
« 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