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

Side by Side Diff: chrome/test/data/extensions/api_test/bluetooth_low_energy/get_descriptor/runtest.js

Issue 1915243003: API Bindings for GATT server functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@adapter_and_tests
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var error; 5 var error;
6 6
7 function testGetDescriptor() { 7 function testGetDescriptor() {
8 if (error !== undefined) { 8 if (error !== undefined) {
9 chrome.test.sendMessage('fail'); 9 chrome.test.sendMessage('fail');
10 chrome.test.fail(error); 10 chrome.test.fail(error);
11 } 11 }
12 chrome.test.assertTrue(descriptor != null, '\'descriptor\' is null'); 12 chrome.test.assertTrue(descriptor != null, '\'descriptor\' is null');
13 13
14 chrome.test.assertEq('desc_id0', descriptor.instanceId); 14 chrome.test.assertEq('desc_id0', descriptor.instanceId);
15 chrome.test.assertEq('00001221-0000-1000-8000-00805f9b34fb', descriptor.uuid); 15 chrome.test.assertEq('00001221-0000-1000-8000-00805f9b34fb', descriptor.uuid);
16 chrome.test.assertEq(false, descriptor.isLocal);
17 chrome.test.assertEq(charId, descriptor.characteristic.instanceId); 16 chrome.test.assertEq(charId, descriptor.characteristic.instanceId);
18 17
19 var valueBytes = new Uint8Array(descriptor.value); 18 var valueBytes = new Uint8Array(descriptor.value);
20 chrome.test.assertEq(3, descriptor.value.byteLength); 19 chrome.test.assertEq(3, descriptor.value.byteLength);
21 chrome.test.assertEq(0x01, valueBytes[0]); 20 chrome.test.assertEq(0x01, valueBytes[0]);
22 chrome.test.assertEq(0x02, valueBytes[1]); 21 chrome.test.assertEq(0x02, valueBytes[1]);
23 chrome.test.assertEq(0x03, valueBytes[2]); 22 chrome.test.assertEq(0x03, valueBytes[2]);
24 23
25 chrome.test.succeed(); 24 chrome.test.succeed();
26 } 25 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 84
86 chrome.test.sendMessage('ready', function (message) { 85 chrome.test.sendMessage('ready', function (message) {
87 chrome.test.runTests([testGetDescriptor]); 86 chrome.test.runTests([testGetDescriptor]);
88 }); 87 });
89 }); 88 });
90 }); 89 });
91 }); 90 });
92 }); 91 });
93 }); 92 });
94 }); 93 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698