| Index: chrome/test/data/extensions/api_test/bluetooth_low_energy/register_advertisement/runtest.js
|
| diff --git a/chrome/test/data/extensions/api_test/bluetooth_low_energy/register_advertisement/runtest.js b/chrome/test/data/extensions/api_test/bluetooth_low_energy/register_advertisement/runtest.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6ead665eaf456148fd90646122f37e366122dc1b
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/api_test/bluetooth_low_energy/register_advertisement/runtest.js
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +var registerAdvertisement =
|
| + chrome.bluetoothLowEnergy.registerAdvertisement;
|
| +var unregisterAdvertisement =
|
| + chrome.bluetoothLowEnergy.unregisterAdvertisement;
|
| +
|
| +var serviceUuidsValue = ['value1', 'value2'];
|
| +var manufacturerDataValue = [{id: 321, data: [1, 2, 3]},
|
| + {id: 567, data: [8, 2, 3]}]
|
| +var solicitUuidsValue = ['value3', 'value4'];
|
| +var serviceDataValue = [{uuid: 'uuid8', data: [1, 2, 3]},
|
| + {uuid: 'uuid36', data: [8, 2, 3]}]
|
| +
|
| +var advertisement = {
|
| + type: 'broadcast',
|
| + serviceUuids: serviceUuidsValue,
|
| + manufacturerData: manufacturerDataValue,
|
| + solicitUuids: solicitUuidsValue,
|
| + serviceData: serviceDataValue
|
| +};
|
| +
|
| +registerAdvertisement(advertisement, function (advertisementId) {
|
| + if (chrome.runtime.lastError || !advertisementId) {
|
| + chrome.test.fail(chrome.runtime.lastError.message);
|
| + return;
|
| + }
|
| +
|
| + unregisterAdvertisement(advertisementId, function () {
|
| + if (chrome.runtime.lastError) {
|
| + chrome.test.fail(chrome.runtime.lastError.message);
|
| + return;
|
| + }
|
| + chrome.test.succeed();
|
| + });
|
| +});
|
|
|