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, '*'); |