1cb4ce5ee14bccc70dda1a06853c816519d4ab9b
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3
4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
5
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
9
10     http://www.apache.org/licenses/LICENSE-2.0
11
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.
17
18
19
20 Authors:
21         Witold Choinkowski <w.choinkowsk@samsung.com>
22
23 -->
24 <html>
25 <head>
26 <title>BluetoothHealthApplication_unregister_with_errorCallback</title>
27 <script src="support/unitcommon.js"></script>
28 <script src="support/bluetooth_common.js"></script>
29 </head>
30 <body>
31
32 <div id="log"></div>
33 <script>
34 //==== TEST: BluetoothHealthApplication_unregister_with_errorCallback
35 //==== LABEL Check unregister with successCallback and errorCallback
36 //==== PRIORITY P1
37 //==== ONLOAD_DELAY 180
38 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothHealthApplication:unregister M
39 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
40 //==== TEST_CRITERIA MOA MAST
41
42 setup({timeout: 180000});
43 var adapter, healthProfileHandler, powerOnSuccess, healthRegisterSuccess, healthRegisterError,
44     t = async_test(document.title, {timeout: 180000}), appName = "testSinkApp",
45     successCallback, errorCallback;
46
47 t.step(function () {
48     adapter = tizen.bluetooth.getDefaultAdapter();
49
50     successCallback = t.step_func(function () {
51         t.done();
52     });
53
54     errorCallback = t.step_func(function (e) {
55         assert_unreached("unregister error:" + e.message);
56     });
57
58     healthRegisterSuccess = t.step_func(function (registerHealthApp) {
59         registerHealthApp.unregister(successCallback, errorCallback);
60     });
61
62     healthRegisterError = t.step_func(function (e) {
63         assert_unreached("healthRegisterError exception:" + e.message);
64     });
65
66     powerOnSuccess = t.step_func(function () {
67         healthProfileHandler = adapter.getBluetoothProfileHandler("HEALTH");
68         healthProfileHandler.registerSinkApplication(REMOTE_HEALTH_DEVICE_TYPE, appName, healthRegisterSuccess, healthRegisterError);
69     });
70
71     setPowered(t, adapter, powerOnSuccess);
72 });
73
74 </script>
75 </body>
76 </html>