Bluetooth: extend JavaScript Device object
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / bluetooth / get_profiles / runtest.js
blob0e70a49fc4aaf719fb6493a0cf1bb038079c8f1f
1 // Copyright 2013 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 testGetProfiles() {
6   chrome.test.assertEq(2, profiles.length);
7   chrome.test.assertEq('1234', profiles[0].uuid);
8   chrome.test.assertEq('5678', profiles[1].uuid);
9   chrome.test.succeed();
12 var profiles = [];
14 function failOnError() {
15   if (chrome.runtime.lastError) {
16     chrome.test.fail(chrome.runtime.lastError.message);
17   }
20 chrome.bluetooth.getProfiles(
21   {
22     device: {
23     name: 'device',
24     address: '11:12:13:14:15:16',
25     paired: false,
26     connected: false,
27     deviceClass: 0x0
28     }
29   },
30   function(results) {
31     failOnError();
32     profiles = results;
33     chrome.test.sendMessage('ready',
34       function(message) {
35         chrome.test.runTests([testGetProfiles]);
36       });
37   });