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

Side by Side Diff: third_party/WebKit/LayoutTests/bluetooth/characteristicvaluechanged.html

Issue 1865613002: bluetooth: Move read value to mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-separate-tests-notifications
Patch Set: Address jyasskin's comments Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../resources/bluetooth/bluetooth-helpers.js"></script> 4 <script src="../resources/bluetooth/bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, 7 test(t => { assert_true(window.testRunner instanceof Object); t.done(); },
8 'window.testRunner is required for the following tests.'); 8 'window.testRunner is required for the following tests.');
9 9
10 // WebBluetoothServiceImpl is in charge of sending characteristicvaluechanged
11 // events. WebBluetoothServiceImpl is lazily initialized so without a
12 // call to startNotifications, stopNotifications, or writeValue, there will
13 // be no events sent to the renderer. This will get solved once we move
14 // readValue over to mojo.
15 // TODO(ortuno): Re-enable once we readValue to mojo.
16 // http://crbug.com/508771
17 if (false) {
18 promise_test(() => { 10 promise_test(() => {
19 return setBluetoothFakeAdapter('HeartRateAdapter') 11 return setBluetoothFakeAdapter('HeartRateAdapter')
20 .then(() => requestDeviceWithKeyDown({ 12 .then(() => requestDeviceWithKeyDown({
21 filters: [{services: ['heart_rate']}]})) 13 filters: [{services: ['heart_rate']}]}))
22 .then(device => device.gatt.connect()) 14 .then(device => device.gatt.connect())
23 .then(gattServer => gattServer.getPrimaryService('heart_rate')) 15 .then(gattServer => gattServer.getPrimaryService('heart_rate'))
24 .then(service => service.getCharacteristic('body_sensor_location')) 16 .then(service => service.getCharacteristic('body_sensor_location'))
25 .then(characteristic => { 17 .then(characteristic => {
26 return assert_event_fires_after_promise(characteristic, 18 return assert_event_fires_after_promise(characteristic,
27 'readValue', 19 'readValue',
(...skipping 28 matching lines...) Expand all
56 for (let event_value of event_values) { 48 for (let event_value of event_values) {
57 // TODO(ortuno): The DataView used to resolve the promise 49 // TODO(ortuno): The DataView used to resolve the promise
58 // should be the same DataView as the one saved in the 50 // should be the same DataView as the one saved in the
59 // characteristic. 51 // characteristic.
60 // http://crbug.com/543347 52 // http://crbug.com/543347
61 // assert_equals(event.target.value, value); 53 // assert_equals(event.target.value, value);
62 assert_array_equals(event_value, read_value); 54 assert_array_equals(event_value, read_value);
63 } 55 }
64 }); 56 });
65 }, 'Add multiple event listeners then readValue().'); 57 }, 'Add multiple event listeners then readValue().');
66 }
67 </script> 58 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698