OLD | NEW |
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 Loading... |
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> |
OLD | NEW |