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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/hide-detach.html

Issue 1611773002: bluetooth: Disconnect if the page becomes hidden or is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Address jyasskin's comments Created 4 years, 11 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/bluetooth/disconnect-frame-detached/hide-detach.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/hide-detach.html b/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/hide-detach.html
new file mode 100644
index 0000000000000000000000000000000000000000..8e78f87d2b7897ccaa9542f92cda3fc3c47dbe06
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/hide-detach.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/bluetooth-helpers.js"></script>
+<body>
+ <script>
+ "use strict";
+ async_test(test => {
+ window.onmessage = messageEvent => test.step(() => {
+ if (messageEvent.data === 'Ready') {
+ let iframe = document.querySelector('iframe');
+ callWithKeyDown(() => {
+ iframe.contentWindow.postMessage('Go', '*');
+ });
+ } else if (messageEvent.data === 'Connected') {
+ // Hide
+ testRunner.setPageVisibility('hidden');
+ // Detach
+ iframe.remove();
+ test.done();
+ } else {
+ assert_unreached('iframe send invalid data: ' + messageEvent.data);
+ }
+ });
+ testRunner.setBluetoothMockDataSet('HeartRateAdapter');
+ let iframe = document.createElement('iframe');
+ iframe.src = '../resources/disconnect-tab-in-iframe.html';
+ document.body.appendChild(iframe);
+ }, 'Hide then detach frame. We shouln\'t crash.');
+ test(() => assert_true(false));
+ </script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698