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
3 // found in the LICENSE file.
5 function testDeviceInfo() {
6 chrome.test.assertEq(2, devices.length);
8 chrome.test.assertEq('Chromebook Pixel', devices[0].name);
9 chrome.test.assertEq(0x080104, devices[0].deviceClass);
10 chrome.test.assertEq('bluetooth', devices[0].vendorIdSource);
11 chrome.test.assertEq(0x00E0, devices[0].vendorId);
12 chrome.test.assertEq(0x240A, devices[0].productId);
13 chrome.test.assertEq(0x0400, devices[0].deviceId);
14 chrome.test.assertEq('computer', devices[0].type);
16 chrome.test.assertEq(2, devices[0].uuids.length);
17 chrome.test.assertEq('00001105-0000-1000-8000-00805f9b34fb',
19 chrome.test.assertEq('00001106-0000-1000-8000-00805f9b34fb',
22 chrome.test.assertEq('d2', devices[1].name);
23 chrome.test.assertEq(0, devices[1].deviceClass);
24 chrome.test.assertEq(undefined, devices[1].vendorIdSource);
25 chrome.test.assertEq(undefined, devices[1].vendorId);
26 chrome.test.assertEq(undefined, devices[1].productId);
27 chrome.test.assertEq(undefined, devices[1].deviceId);
28 chrome.test.assertEq(undefined, devices[1].type);
29 chrome.test.assertEq(0, devices[1].uuids.length);
31 chrome.test.succeed();
36 function failOnError() {
37 if (chrome.runtime.lastError) {
38 chrome.test.fail(chrome.runtime.lastError.message);
42 chrome.bluetooth.getDevices(
46 chrome.test.sendMessage('ready',
48 chrome.test.runTests([testDeviceInfo]);