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

Unified Diff: third_party/WebKit/LayoutTests/bluetooth/resources/connectGATT-iframe.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 #2 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/resources/connectGATT-iframe.html
diff --git a/third_party/WebKit/LayoutTests/bluetooth/resources/requestDevice-in-iframe.html b/third_party/WebKit/LayoutTests/bluetooth/resources/connectGATT-iframe.html
similarity index 51%
copy from third_party/WebKit/LayoutTests/bluetooth/resources/requestDevice-in-iframe.html
copy to third_party/WebKit/LayoutTests/bluetooth/resources/connectGATT-iframe.html
index ac51b07440dd895f2b8494d6aee43a5293b1fadc..7c5fa721867655966580721a48cbdc3db9dd8dcb 100644
--- a/third_party/WebKit/LayoutTests/bluetooth/resources/requestDevice-in-iframe.html
+++ b/third_party/WebKit/LayoutTests/bluetooth/resources/connectGATT-iframe.html
@@ -3,13 +3,11 @@
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, '*');
- }
+ filters: [{services: ['heart_rate']}]
+ })
+ .then(device => device.connectGATT())
+ .then(gattServer => {
+ parent.postMessage('Connected', '*');
}).catch(err => {
console.error(err);
parent.postMessage('FAIL: ' + err, '*');

Powered by Google App Engine
This is Rietveld 408576698