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

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

Issue 1573183002: bluetooth: Update BluetoothCharacteristic.value on readValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use anonymous namespace Created 4 years, 11 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 | third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h » ('j') | 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="resources/bluetooth-helpers.js"></script> 4 <script src="resources/bluetooth-helpers.js"></script>
5 <script> 5 <script>
6 'use strict'; 6 'use strict';
7 7
8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); }, 8 test(t => { assert_true(window.testRunner instanceof Object); t.done(); },
9 'window.testRunner is required for the following tests.'); 9 'window.testRunner is required for the following tests.');
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 .then(device => device.connectGATT()) 79 .then(device => device.connectGATT())
80 .then(gattServer => gattServer.getPrimaryService('generic_access')) 80 .then(gattServer => gattServer.getPrimaryService('generic_access'))
81 .then(service => service.getCharacteristic('gap.device_name')) 81 .then(service => service.getCharacteristic('gap.device_name'))
82 .then(characteristic => characteristic.readValue()) 82 .then(characteristic => characteristic.readValue())
83 .then(value => { 83 .then(value => {
84 let decoder = new TextDecoder('utf-8'); 84 let decoder = new TextDecoder('utf-8');
85 let value_str = decoder.decode(value); 85 let value_str = decoder.decode(value);
86 assert_equals(value_str, 'Heart Rate Device'); 86 assert_equals(value_str, 'Heart Rate Device');
87 }); 87 });
88 }, 'Request for characteristic. Should return right characteristic'); 88 }, 'Request for characteristic. Should return right characteristic');
89
90 promise_test(() => {
91 testRunner.setBluetoothMockDataSet('HeartRateAdapter');
92 return requestDeviceWithKeyDown({filters: [{services: ['heart_rate']}]})
93 .then(device => device.connectGATT())
94 .then(gattServer => gattServer.getPrimaryService('generic_access'))
95 .then(service => service.getCharacteristic('gap.device_name'))
96 .then(characteristic => {
97 assert_equals(characteristic.value, null);
98 return characteristic.readValue().then(() => {
99 let decoder = new TextDecoder('utf-8');
100 let value_str = decoder.decode(characteristic.value);
101 assert_equals(value_str, 'Heart Rate Device');
102 })
103 });
104 }, 'Request for characteristic. Should update characteristic.value');
89 </script> 105 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/bluetooth/BluetoothGATTCharacteristic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698