| 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="bluetooth-helpers.js"></script> | 4 <script src="bluetooth-helpers.js"></script> |
| 5 <script> | 5 <script> |
| 6 test(function(t) { assert_exists(window, 'testRunner'); t.done(); }, | 6 test(function(t) { assert_exists(window, 'testRunner'); t.done(); }, |
| 7 'window.testRunner is required for the following tests.'); | 7 'window.testRunner is required for the following tests.'); |
| 8 | 8 |
| 9 // Generic Access Service. | 9 // Generic Access Service. |
| 10 var serviceUUID = '00001800-0000-1000-8000-00805f9b34fb'; | 10 var serviceUUID = '00001800-0000-1000-8000-00805f9b34fb'; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return device.connectGATT(); | 64 return device.connectGATT(); |
| 65 }).then(function(gattServer) { | 65 }).then(function(gattServer) { |
| 66 return gattServer.getPrimaryService(serviceUUID); | 66 return gattServer.getPrimaryService(serviceUUID); |
| 67 }).then(function(service) { | 67 }).then(function(service) { |
| 68 return service.getCharacteristic(includedCharacteristicUUID); | 68 return service.getCharacteristic(includedCharacteristicUUID); |
| 69 }).then(function(characteristic) { | 69 }).then(function(characteristic) { |
| 70 return characteristic.readValue(); | 70 return characteristic.readValue(); |
| 71 }).then(function(value) { | 71 }).then(function(value) { |
| 72 var decoder = new TextDecoder('utf-8'); | 72 var decoder = new TextDecoder('utf-8'); |
| 73 var value_str = decoder.decode(value); | 73 var value_str = decoder.decode(value); |
| 74 // TODO: Remove the .slice after https://crrev.com/1172853004 is in. | 74 assert_equals(value_str, 'Empty Mock Device'); |
| 75 assert_equals(value_str.slice(0, 17), 'Empty Mock Device'); | |
| 76 }); | 75 }); |
| 77 }, 'Request for characteristic. Should return right characteristic'); | 76 }, 'Request for characteristic. Should return right characteristic'); |
| 78 </script> | 77 </script> |
| OLD | NEW |