3 Copyright (c) 2015 Samsung Electronics Co., Ltd.
5 Licensed under the Apache License, Version 2.0 (the License);
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
18 Qunfang Lin <qunfang.lin@samsung.com>
24 <title>BluetoothGATTCharacteristic_removeValueChangeListener_exist</title>
25 <meta charset="utf-8"/>
26 <script src="support/unitcommon.js"></script>
27 <script src="support/bluetooth_common.js"></script>
32 //==== TEST: BluetoothGATTCharacteristic_removeValueChangeListener_exist
33 //==== LABEL Check if BluetoothGATTCharacteristic::removeValueChangeListener method exists
35 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothGATTCharacteristic:removeValueChangeListener M
37 //==== EXECUTION_TYPE manual
38 //==== PRE The bluetooth of the remote/test device MUST support BLE and be turned on and discoverable from other devices.
39 //==== TEST_CRITERIA ME
41 setup({timeout: 60000});
43 var t = async_test(document.title, {timeout: 60000}), adapter, bleScanSuccessCallback, bleScanRrrorCallback,
44 service, characteristic, onconnected, onerror, device = null, flag = false;
47 onconnected = t.step_func(function () {
48 service = device.getService(device.uuids[0]);
49 if (service.characteristics.length > 0) {
50 characteristic = service.characteristics[0];
51 check_method_exists(characteristic, "removeValueChangeListener");
57 onerror = t.step_func(function (error) {
58 assert_unreached("connect() error callback was invoked: " + error.name + " msg: " + error.message);
61 bleScanSuccessCallback = t.step_func(function (bledevice) {
62 if (bledevice.address == REMOTE_BLE_DEVICE_ADDRESS && device == null) {
66 device.connect(onconnected, onerror);
72 bleScanRrrorCallback = t.step_func(function (error) {
73 assert_unreached("startScan() error callback was invoked: " + error.name + " msg: " + error.message);
76 adapter = tizen.bluetooth.getLEAdapter();
78 adapter.startScan(bleScanSuccessCallback, bleScanRrrorCallback);