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.
7 function testGetIncludedServices() {
8 if (error !== undefined) {
9 chrome.test.sendMessage('fail');
10 chrome.test.fail(error);
12 chrome.test.assertTrue(services != null, '\'services\' is null');
13 chrome.test.assertEq(1, services.length);
14 chrome.test.assertEq(includedId, services[0].instanceId);
16 chrome.test.succeed();
19 var serviceId = 'service_id0';
20 var includedId = 'service_id1';
23 function earlyError(message) {
25 chrome.test.runTests([testGetIncludedServices]);
28 function failOnError() {
29 if (chrome.runtime.lastError) {
30 earlyError(chrome.runtime.lastError.message);
36 chrome.bluetoothLowEnergy.getIncludedServices(serviceId, function (result) {
37 // No mapping for |serviceId|.
38 if (result || !chrome.runtime.lastError) {
39 earlyError('getIncludedServices should have failed');
43 chrome.test.sendMessage('ready', function (message) {
44 chrome.bluetoothLowEnergy.getIncludedServices(serviceId, function (result) {
48 if (!result || result.length != 0) {
49 earlyError('Included services should be empty.');
53 chrome.bluetoothLowEnergy.getIncludedServices(serviceId,
60 chrome.test.sendMessage('ready', function (message) {
61 chrome.test.runTests([testGetIncludedServices]);