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

Unified Diff: LayoutTests/bluetooth/resources/requestDevice-in-iframe.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 | « LayoutTests/bluetooth/iframeRequestDevice.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/bluetooth/resources/requestDevice-in-iframe.html
diff --git a/LayoutTests/bluetooth/resources/requestDevice-in-iframe.html b/LayoutTests/bluetooth/resources/requestDevice-in-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..ac51b07440dd895f2b8494d6aee43a5293b1fadc
--- /dev/null
+++ b/LayoutTests/bluetooth/resources/requestDevice-in-iframe.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<script>
+ window.onmessage = messageEvent => {
+ if (messageEvent.data === 'Go') {
+ navigator.bluetooth.requestDevice({
+ filters: [{services: ['generic_access']}]
+ }).then(device => {
+ if (device.constructor.name === "BluetoothDevice") {
+ parent.postMessage('Success', '*');
+ } else {
+ parent.postMessage('FAIL: requestDevice in iframe returned ' + device, '*');
+ }
+ }).catch(err => {
+ console.error(err);
+ parent.postMessage('FAIL: ' + err, '*');
+ });
+ }
+ };
+ parent.postMessage("Ready", "*");
+</script>
« no previous file with comments | « LayoutTests/bluetooth/iframeRequestDevice.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698