982a8edf2f34e730691655b4bf73655aeba3bb8e
[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 <html>
24 <head>
25 <title>BluetoothHealthProfileHandler_registerSinkApplication_errorCallback_invalid_cb</title>
26 <script src="support/unitcommon.js"></script>
27 </head>
28 <body>
29
30 <div id="log"></div>
31 <script>
32 //==== TEST: BluetoothHealthProfileHandler_registerSinkApplication_errorCallback_invalid_cb
33 //==== LABEL Check argument registerSinkApplication() errorCallback validation.
34 //==== PRIORITY P2
35 //==== ONLOAD_DELAY 90
36 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothHealthProfileHandler:registerSinkApplication M
37 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html
38 //==== TEST_CRITERIA MTCB
39
40 setup({timeout: 90000});
41
42 var adapter, t = async_test(document.title, {timeout: 90000}),
43     incorrectCallback, successCallback, healthProfileHandler, exceptionName = "TypeMismatchError";
44 t.step(function () {
45     adapter = tizen.bluetooth.getDefaultAdapter();
46     healthProfileHandler = adapter.getBluetoothProfileHandler("HEALTH");
47
48     incorrectCallback = {
49         onerror: t.step_func(function (error) {
50             assert_unreached("Invalid errorCallback invoked: " + error.name + ": " + error.message);
51         })
52     };
53
54     successCallback = t.step_func(function () {
55         assert_unreached("Method registerSinkApplication shouldn't end successfully.");
56     });
57
58     assert_throws({name: exceptionName},
59         function () {
60             healthProfileHandler.registerSinkApplication(4100, "testSinkApp", successCallback, incorrectCallback);
61         }, "Given incorrect errorCallback.");
62
63     t.done();
64 });
65
66 </script>
67 </body>
68 </html>