4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 Licensed under the Apache License, Version 2.0 (the License);
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
21 Lukasz Bardeli <l.bardeli@samsung.com>
26 <title>BluetoothAdapter_destroyBonding_successCallback_TypeMismatch</title>
27 <script src="support/unitcommon.js"></script>
28 <script src="support/bluetooth_common.js"></script>
34 //==== TEST: BluetoothAdapter_destroyBonding_successCallback_TypeMismatch
35 //==== LABEL Check whether destroyBonding() method called with invalid successCallback argument throws an exception.
37 //==== EXECUTION_TYPE manual
38 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:destroyBonding M
39 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
40 //==== PRE The bluetooth of the remote device MUST be turned on and discoverable from other devices.
41 //==== TEST_CRITERIA MC
42 setup({timeout: 90000});
43 var adapter = null, t = async_test(document.title, {timeout: 90000}), exceptionName, i,
44 conversionTable, errorCallback, onBondingSuccess, onBondingError, powerOnSuccess, successCallback;
46 conversionTable = getTypeConversionExceptions("functionObject", true);
48 errorCallback = t.step_func(function (e) {
49 assert_unreached("errorCallback exception:" + e.message);
52 onBondingSuccess = t.step_func(function () {
53 for(i = 0; i < conversionTable.length; i++) {
54 successCallback = conversionTable[i][0];
55 exceptionName = conversionTable[i][1];
57 assert_throws({name: exceptionName},
59 adapter.destroyBonding(REMOTE_DEVICE_ADDRESS, successCallback, errorCallback);
60 }, "Given incorrect successCallback.");
65 onBondingError = t.step_func(function (e) {
66 assert_unreached("onBondingError exception:" + e.message);
69 powerOnSuccess = t.step_func(function () {
70 adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
73 adapter = tizen.bluetooth.getDefaultAdapter();
74 setPowered(t, adapter, powerOnSuccess);