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

Side by Side Diff: LayoutTests/bluetooth/readValue.html

Issue 1179733006: bluetooth: Comment out a test to change behavior on browser side. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-add-errors
Patch Set: Comment out test Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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="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 25 matching lines...) Expand all
36 return navigator.bluetooth.requestDevice().then(function(device) { 36 return navigator.bluetooth.requestDevice().then(function(device) {
37 return device.connectGATT(); 37 return device.connectGATT();
38 }).then(function(gattServer) { 38 }).then(function(gattServer) {
39 return gattServer.getPrimaryService(serviceUUID); 39 return gattServer.getPrimaryService(serviceUUID);
40 }).then(function(service) { 40 }).then(function(service) {
41 return service.getCharacteristic(unreadableCharacteristicUUID); 41 return service.getCharacteristic(unreadableCharacteristicUUID);
42 }).then(function(characteristic) { 42 }).then(function(characteristic) {
43 return characteristic.readValue().then(function() { 43 return characteristic.readValue().then(function() {
44 assert_unreached('Characteristic is unreadable. Should fail.'); 44 assert_unreached('Characteristic is unreadable. Should fail.');
45 }, function(e) { 45 }, function(e) {
46 // TODO(ortuno): Should be NotSupportedError when implemented. 46 // TODO(ortuno): Uncomment once browser side patch lands.
47 // https://crbug.com/436283 47 // assert_equals(e.name, 'NotSupportedError');
48 assert_equals(e.name, 'NetworkError');
49 }); 48 });
50 }); 49 });
51 }, 'Characteristic is not readable. Reject with NetworkError.'); 50 }, 'Characteristic is not readable. Reject with NetworkError.');
52 51
53 // TODO(ortuno): Add a test for when a characterstics gets removed. 52 // TODO(ortuno): Add a test for when a characterstics gets removed.
54 // http://crbug.com/499552 53 // http://crbug.com/499552
55 54
56 sequential_promise_test(function() { 55 sequential_promise_test(function() {
57 testRunner.setBluetoothMockDataSet('ConnectableDeviceAdapter'); 56 testRunner.setBluetoothMockDataSet('ConnectableDeviceAdapter');
58 return navigator.bluetooth.requestDevice().then(function(device) { 57 return navigator.bluetooth.requestDevice().then(function(device) {
59 return device.connectGATT(); 58 return device.connectGATT();
60 }).then(function(gattServer) { 59 }).then(function(gattServer) {
61 return gattServer.getPrimaryService(serviceUUID); 60 return gattServer.getPrimaryService(serviceUUID);
62 }).then(function(service) { 61 }).then(function(service) {
63 return service.getCharacteristic(includedCharacteristicUUID); 62 return service.getCharacteristic(includedCharacteristicUUID);
64 }).then(function(characteristic) { 63 }).then(function(characteristic) {
65 return characteristic.readValue(); 64 return characteristic.readValue();
66 }).then(function(value) { 65 }).then(function(value) {
67 var decoder = new TextDecoder('utf-8'); 66 var decoder = new TextDecoder('utf-8');
68 var value_str = decoder.decode(value); 67 var value_str = decoder.decode(value);
69 assert_equals(value_str, 'Empty Mock Device name'); 68 assert_equals(value_str, 'Empty Mock Device name');
70 }); 69 });
71 }, 'Request for characteristic. Should return right characteristic'); 70 }, 'Request for characteristic. Should return right characteristic');
72 </script> 71 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698