Index: third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html |
diff --git a/third_party/WebKit/LayoutTests/bluetooth/notifications/add-multiple-event-listeners.html b/third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html |
similarity index 52% |
copy from third_party/WebKit/LayoutTests/bluetooth/notifications/add-multiple-event-listeners.html |
copy to third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html |
index 6f8116e982326a784b37b80a831df0647b70e361..b57c1bad824031eed467ff2af0f10343d1ee2b6d 100644 |
--- a/third_party/WebKit/LayoutTests/bluetooth/notifications/add-multiple-event-listeners.html |
+++ b/third_party/WebKit/LayoutTests/bluetooth/readValue/event-is-fired.html |
@@ -5,21 +5,25 @@ |
<script> |
'use strict'; |
promise_test(() => { |
- let char; |
return setBluetoothFakeAdapter('HeartRateAdapter') |
.then(() => requestDeviceWithKeyDown({ |
filters: [{services: ['heart_rate']}]})) |
.then(device => device.gatt.connect()) |
.then(gattServer => gattServer.getPrimaryService('heart_rate')) |
- .then(service => service.getCharacteristic('heart_rate_measurement')) |
+ .then(service => service.getCharacteristic('body_sensor_location')) |
.then(characteristic => { |
- char = characteristic; |
return assert_event_fires_after_promise(characteristic, |
- 'startNotifications', |
- 'characteristicvaluechanged', |
- 3 /* add 3 listeners */); |
- }) |
- .then(() => char.stopNotifications()) |
- .then(() => assert_no_events(char, 'characteristicvaluechanged')); |
-}, 'Add multiple event listeners then startNotifications().'); |
+ 'readValue', |
+ 'characteristicvaluechanged'); |
+ }).then(results => { |
+ let read_value = results[0].buffer; |
+ let event_value = results[1].buffer; |
+ // TODO(ortuno): The DataView used to resolve the promise |
+ // should be the same DataView as the one saved in the |
+ // characteristic. |
+ // http://crbug.com/543347 |
+ // assert_equals(event.target.value, value); |
+ assert_array_equals(event_value, read_value); |
+ }); |
+}, 'Reading a characteristic should fire an event.'); |
</script> |