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 Witold Choinkowski <w.choinkowsk@samsung.com>
27 <title>BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback</title>
28 <script src="../resources/unitcommon.js"></script>
29 <script src="support/bluetooth_common.js"></script>
34 //==== TEST: BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback
35 //==== LABEL check registerSinkApplication with valid optional arguments
36 //==== ONLOAD_DELAY 90
37 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothHealthProfileHandler:registerSinkApplication M
38 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
39 //==== TEST_CRITERIA MOA MAST
41 setup({timeout: 90000, explicit_done:true});
43 var adapter, t = async_test("BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback", {timeout: 90000}), healthProfileHandler,
44 powerOnSuccess, powerOnError, healthRegisterSuccess, healthRegisterError;
47 healthRegisterSuccess = t.step_func(function (app) {
48 setBluetoothHandlerCleanup(app);
49 assert_type(app, "object", "argument app has wrong type");
54 healthRegisterError = t.step_func(function (e) {
55 assert_unreached("gotDeviceError exception:" + e.message);
58 powerOnSuccess = t.step_func(function () {
59 healthProfileHandler = adapter.getBluetoothProfileHandler("HEALTH");
60 healthProfileHandler.registerSinkApplication(4100, "testSinkApp", healthRegisterSuccess);
63 powerOnError = t.step_func(function (e) {
64 assert_unreached("powerOnError exception:" + e.message);
67 adapter = tizen.bluetooth.getDefaultAdapter();
68 adapter.setPowered(true, powerOnSuccess, powerOnError);