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

Unified Diff: LayoutTests/bluetooth/readValue.html

Issue 1182973002: Implement the Blink side of RequestDeviceOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@pinned
Patch Set: Prepare readValue.html for a mock data change Created 5 years, 6 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: LayoutTests/bluetooth/readValue.html
diff --git a/LayoutTests/bluetooth/readValue.html b/LayoutTests/bluetooth/readValue.html
index 1757f3cc1d76fa680038d4c120d93a570c7c44ed..e2221a55b4e2ff46570aeca07fab69a34d66f889 100644
--- a/LayoutTests/bluetooth/readValue.html
+++ b/LayoutTests/bluetooth/readValue.html
@@ -15,7 +15,9 @@ var unreadableCharacteristicUUID = '00002a03-0000-1000-8000-00805f9b34fb';
sequential_promise_test(function() {
testRunner.setBluetoothMockDataSet('ConnectableDeviceAdapter');
- return navigator.bluetooth.requestDevice().then(function(device) {
+ return navigator.bluetooth.requestDevice({
+ filters: [{services: [serviceUUID]}]
+ }).then(function(device) {
return device.connectGATT();
}).then(function(gattServer) {
return gattServer.getPrimaryService(serviceUUID);
@@ -33,7 +35,9 @@ sequential_promise_test(function() {
sequential_promise_test(function() {
testRunner.setBluetoothMockDataSet('ConnectableDeviceAdapter');
- return navigator.bluetooth.requestDevice().then(function(device) {
+ return navigator.bluetooth.requestDevice({
+ filters: [{services: [serviceUUID]}]
+ }).then(function(device) {
return device.connectGATT();
}).then(function(gattServer) {
return gattServer.getPrimaryService(serviceUUID);
@@ -54,7 +58,9 @@ sequential_promise_test(function() {
sequential_promise_test(function() {
testRunner.setBluetoothMockDataSet('ConnectableDeviceAdapter');
- return navigator.bluetooth.requestDevice().then(function(device) {
+ return navigator.bluetooth.requestDevice({
+ filters: [{services: [serviceUUID]}]
+ }).then(function(device) {
return device.connectGATT();
}).then(function(gattServer) {
return gattServer.getPrimaryService(serviceUUID);
@@ -65,7 +71,8 @@ sequential_promise_test(function() {
}).then(function(value) {
var decoder = new TextDecoder('utf-8');
var value_str = decoder.decode(value);
- assert_equals(value_str, 'Empty Mock Device name');
+ // TODO: Remove the .slice after https://crrev.com/1172853004 is in.
+ assert_equals(value_str.slice(0, 17), 'Empty Mock Device');
});
}, 'Request for characteristic. Should return right characteristic');
</script>

Powered by Google App Engine
This is Rietveld 408576698