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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/bluetooth/https/requestDevice/cross-origin-iframe.html

Issue 1862953002: Disallow use of Web Bluetooth from cross-origin iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Add a test. Created 4 years, 8 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
Index: third_party/WebKit/LayoutTests/http/tests/bluetooth/https/requestDevice/cross-origin-iframe.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/requestDevice-sandboxed-iframe.html b/third_party/WebKit/LayoutTests/http/tests/bluetooth/https/requestDevice/cross-origin-iframe.html
similarity index 61%
copy from third_party/WebKit/LayoutTests/bluetooth/requestDevice-sandboxed-iframe.html
copy to third_party/WebKit/LayoutTests/http/tests/bluetooth/https/requestDevice/cross-origin-iframe.html
index e75b1312e3da0c0923d33ff03b2d91add74aa364..11917a25e81e30a19c18c0724624b08a07936f93 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/requestDevice-sandboxed-iframe.html
+++ b/third_party/WebKit/LayoutTests/http/tests/bluetooth/https/requestDevice/cross-origin-iframe.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
-<script src="../resources/testharness.js"></script>
-<script src="../resources/testharnessreport.js"></script>
-<script src="../resources/bluetooth/bluetooth-helpers.js"></script>
+<script src="/js-test-resources/testharness.js"></script>
+<script src="/js-test-resources/testharnessreport.js"></script>
+<script src="/js-test-resources/bluetooth/bluetooth-helpers.js"></script>
<body>
<script>
"use strict";
@@ -14,16 +14,14 @@
});
} else {
assert_equals(messageEvent.data, 'SecurityError: requestDevice() ' +
- 'called from sandboxed or otherwise ' +
- 'unique origin.');
+ 'called from cross-origin iframe.');
test.done();
}
});
setBluetoothFakeAdapter('HeartRateAdapter')
.then(() => {
let iframe = document.createElement('iframe');
- iframe.sandbox.add('allow-scripts');
- iframe.src = '../resources/bluetooth/requestDevice-in-sandboxed-iframe.html';
+ iframe.src = 'https://localhost:8443/js-test-resources/bluetooth/requestDevice-in-iframe.html';
document.body.appendChild(iframe);
});
}, 'Request device from a unique origin. Should reject with SecurityError.');

Powered by Google App Engine
This is Rietveld 408576698