Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / api_test / bluetooth_low_energy / get_removed_characteristic / runtest.js
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.
4
5 var getCharacteristic = chrome.bluetoothLowEnergy.getCharacteristic;
6 var charId = 'char_id0';
7
8 getCharacteristic(charId, function (result) {
9   if (chrome.runtime.lastError) {
10     chrome.test.sendMessage(chrome.runtime.lastError.message);
11   }
12
13   chrome.test.assertEq(charId, result.instanceId);
14
15   chrome.test.sendMessage('ready', function (message) {
16     getCharacteristic(charId, function (result) {
17       if (result || !chrome.runtime.lastError) {
18         chrome.test.sendMessage('Call to getCharacteristic should have failed');
19       }
20
21       chrome.test.sendMessage('ready', function (message) {
22         chrome.test.succeed();
23       });
24     });
25   });
26 });