Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <script src="resources/bluetooth-helpers.js"></script> | |
| 5 <script> | |
| 6 'use strict'; | |
| 7 | |
| 8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, | |
| 9 'window.testRunner is required for the following tests.'); | |
| 10 | |
| 11 // TODO(ortuno): Write tests to check that "Disconnect" was actually | |
| 12 // called on the device. | |
| 13 // http://crbug.com/569716 | |
| 14 promise_test(() => { | |
|
Jeffrey Yasskin
2016/01/14 22:13:18
Could you add a name to each of these tests that s
ortuno
2016/01/15 01:00:08
Done.
| |
| 15 testRunner.setBluetoothMockDataSet('HeartRateAdapter'); | |
| 16 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) | |
| 17 .then(device => device.connectGATT()) | |
| 18 .then(gattServer => { | |
| 19 gattServer.disconnect(); | |
| 20 assert_false(gattServer.connected); | |
| 21 }); | |
| 22 }); | |
| 23 | |
| 24 promise_test(() => { | |
| 25 testRunner.setBluetoothMockDataSet('HeartRateAdapter'); | |
| 26 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) | |
| 27 .then(device => device.connectGATT()) | |
| 28 .then(gattServer => { | |
| 29 gattServer.disconnect(); | |
| 30 assert_false(gattServer.connected); | |
| 31 gattServer.disconnect(); | |
| 32 assert_false(gattServer.connected); | |
| 33 }); | |
| 34 }); | |
| 35 | |
| 36 promise_test(() => { | |
| 37 testRunner.setBluetoothMockDataSet('HeartRateAdapter'); | |
| 38 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]}) | |
| 39 .then(device => { | |
| 40 return device.connectGATT().then(gattServer => { | |
|
Jeffrey Yasskin
2016/01/14 22:13:18
Could you add a test that calls "device.connectGAT
ortuno
2016/01/15 01:00:08
Hmm there is no device.disconnect.
Jeffrey Yasskin
2016/01/15 01:12:19
True. It'd have to be:
device.connectGATT().then(g
ortuno
2016/01/15 01:33:14
Ack.
| |
| 41 gattServer.disconnect(); | |
| 42 assert_false(gattServer.connected); | |
| 43 }) | |
| 44 .then(() => device.connectGATT()).then(gattServer => { | |
| 45 gattServer.disconnect(); | |
| 46 assert_false(gattServer.connected); | |
| 47 }); | |
| 48 }); | |
| 49 }); | |
| 50 </script> | |
| OLD | NEW |