| OLD | NEW |
| 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 testGetCharacteristic() { | 7 function testGetCharacteristic() { |
| 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(characteristic != null, | 12 chrome.test.assertTrue(characteristic != null, |
| 13 'Characteristic is null.'); | 13 'Characteristic is null.'); |
| 14 chrome.test.assertEq('char_id0', characteristic.instanceId); | 14 chrome.test.assertEq('char_id0', characteristic.instanceId); |
| 15 chrome.test.assertEq('00001211-0000-1000-8000-00805f9b34fb', | 15 chrome.test.assertEq('00001211-0000-1000-8000-00805f9b34fb', |
| 16 characteristic.uuid); | 16 characteristic.uuid); |
| 17 chrome.test.assertEq(false, characteristic.isLocal); | |
| 18 chrome.test.assertEq(serviceId, characteristic.service.instanceId); | 17 chrome.test.assertEq(serviceId, characteristic.service.instanceId); |
| 19 chrome.test.assertEq(4, characteristic.properties.length); | 18 chrome.test.assertEq(4, characteristic.properties.length); |
| 20 chrome.test.assertTrue(characteristic.properties.indexOf('broadcast') > -1, | 19 chrome.test.assertTrue(characteristic.properties.indexOf('broadcast') > -1, |
| 21 '\'broadcast\' not in characteristic.properties'); | 20 '\'broadcast\' not in characteristic.properties'); |
| 22 chrome.test.assertTrue(characteristic.properties.indexOf('read') > -1, | 21 chrome.test.assertTrue(characteristic.properties.indexOf('read') > -1, |
| 23 '\'read\' not in characteristic.properties'); | 22 '\'read\' not in characteristic.properties'); |
| 24 chrome.test.assertTrue(characteristic.properties.indexOf('indicate') > -1, | 23 chrome.test.assertTrue(characteristic.properties.indexOf('indicate') > -1, |
| 25 '\'indicate\' not in characteristic.properties'); | 24 '\'indicate\' not in characteristic.properties'); |
| 26 chrome.test.assertTrue( | 25 chrome.test.assertTrue( |
| 27 characteristic.properties.indexOf('writeWithoutResponse') > -1, | 26 characteristic.properties.indexOf('writeWithoutResponse') > -1, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 characteristic = result; | 83 characteristic = result; |
| 85 | 84 |
| 86 chrome.test.sendMessage('ready', function (message) { | 85 chrome.test.sendMessage('ready', function (message) { |
| 87 chrome.test.runTests([testGetCharacteristic]); | 86 chrome.test.runTests([testGetCharacteristic]); |
| 88 }); | 87 }); |
| 89 }); | 88 }); |
| 90 }); | 89 }); |
| 91 }) | 90 }) |
| 92 }); | 91 }); |
| 93 }); | 92 }); |
| OLD | NEW |