f941d5dc55b643afcce25a20b08d08ae2a6f6640
[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>BluetoothHealthProfileHandler_registerSinkApplication_errorCallback_TypeMismatch</title>
27 <script src="support/unitcommon.js"></script>
28 </head>
29 <body>
30
31 <div id="log"></div>
32 <script>
33 //==== TEST: BluetoothHealthProfileHandler_registerSinkApplication_errorCallback_TypeMismatch
34 //==== LABEL Check whether registerSinkApplication() method called with invalid errorCallback argument throws an exception.
35 //==== PRIORITY P2
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 MC
40
41 setup({timeout: 90000});
42
43 var adapter, healthProfileHandler, errorCallback, exceptionName, i, conversionTable = getTypeConversionExceptions("functionObject", true),
44     successCallback, t = async_test(document.title, {timeout: 90000});
45 t.step(function () {
46     adapter = tizen.bluetooth.getDefaultAdapter();
47     healthProfileHandler = adapter.getBluetoothProfileHandler("HEALTH");
48
49     successCallback = t.step_func(function (app) {
50         assert_unreached("Method registerSinkApplication shouldn't end successfully.");
51     });
52
53     for(i = 0; i < conversionTable.length; i++) {
54         errorCallback = conversionTable[i][0];
55         exceptionName = conversionTable[i][1];
56
57         assert_throws({name: exceptionName},
58             function () {
59                 healthProfileHandler.registerSinkApplication(4100, "testSinkApp", successCallback, errorCallback);
60             }, "Given incorrect errorCallback.");
61         t.done();
62     }
63 });
64
65 </script>
66 </body>
67 </html>