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 testGetIncludedServices() {
6 chrome.test.assertTrue(services != null, '\'services\' is null');
7 chrome.test.assertEq(1, services.length);
8 chrome.test.assertEq(includedId, services[0].instanceId);
10 chrome.test.succeed();
13 var serviceId = 'service_id0';
14 var includedId = 'service_id1';
17 function failOnError() {
18 if (chrome.runtime.lastError) {
19 chrome.test.fail(chrome.runtime.lastError.message);
23 chrome.bluetoothLowEnergy.getIncludedServices(serviceId, function (result) {
24 // No mapping for |serviceId|.
25 if (result || !chrome.runtime.lastError) {
26 chrome.test.fail('getIncludedServices should have failed');
29 chrome.test.sendMessage('ready', function (message) {
30 chrome.bluetoothLowEnergy.getIncludedServices(serviceId, function (result) {
32 if (!result || result.length != 0) {
33 chrome.test.fail('Included services should be empty.');
36 chrome.bluetoothLowEnergy.getIncludedServices(serviceId,
41 chrome.test.sendMessage('ready', function (message) {
42 chrome.test.runTests([testGetIncludedServices]);