Index: third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/gc-detach.html |
diff --git a/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/gc-detach.html b/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/gc-detach.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e5b4fda00399f5e7f4b2521d73f30e3b829e7fe4 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/gc-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') { |
+ // GC |
+ runGarbageCollection().then(() => { |
+ // Detach |
+ iframe.remove(); |
+ test.done(); |
+ }); |
+ } else { |
+ assert_unreached('iframe sent invalid data: ' + messageEvent.data); |
+ } |
+ }); |
+ testRunner.setBluetoothMockDataSet('HeartRateAdapter'); |
+ let iframe = document.createElement('iframe'); |
+ iframe.src = '../resources/connectGATT-iframe.html'; |
+ document.body.appendChild(iframe); |
+ }, 'Garbage collect then detach frame. We shouldn\'t crash.'); |
+ </script> |
+</body> |