29e13bfd9288a6d9bb83267edd59e9dd76d19e87
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2
3 <!--
4
5 Copyright (c) 2013 Samsung Electronics Co., Ltd.
6
7 Licensed under the Apache License, Version 2.0 (the License);
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11     http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19
20
21 Authors:
22         Mariusz Polasinski <m.polasinski@samsung.com>
23
24
25 -->
26
27 <html>
28
29 <head>
30 <title>ApplicationManager_findAppControl_errorCallback_invalid_cb</title>
31 <meta charset="utf-8">
32 <script type="text/javascript" src="../resources/testharness.js"></script>
33 <script type="text/javascript" src="../resources/testharnessreport.js"></script>
34 <script type="text/javascript" src="support/app_common.js"></script>
35 </head>
36
37 <body>
38 <div id="log"></div>
39 <script type="text/javascript">
40
41 //==== TEST: ApplicationManager_findAppControl_errorCallback_invalid_cb
42 //==== LABEL check if an exception was thrown when a fake callback (onerror) was passed into findAppControl method
43 //==== ONLOAD_DELAY 30
44 //==== SPEC Tizen Web API:Application:Application:ApplicationManager:findAppControl M
45 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/application.html
46 //==== PRIORITY P2
47 //==== TEST_CRITERIA MTCB
48
49 setup({timeout: 30000});
50
51 var this_test = async_test("ApplicationManager_findAppControl_errorCallback_invalid_cb", {timeout: 30000}),
52     findSuccess, findErrorFunc, findError, appControl;
53
54 this_test.step(function () {
55     appControl = new tizen.ApplicationControl(
56         TCT_APPCONTROL_LAUNCH_APPCONTROL_OPERATION
57     );
58
59     findSuccess = this_test.step_func(function () {
60         assert_unreached("this function should not be run");
61     });
62
63     findErrorFunc = this_test.step_func(function (error) {
64         assert_unreached("findAppControl() error callback invoked: name:" + error.name + "msg:" + error.message);
65     });
66
67     findError = {
68         onerror: findErrorFunc
69     };
70
71     assert_throws(TYPE_MISMATCH_ERR, function () {
72         tizen.application.findAppControl(appControl, findSuccess, findError);
73     }, "exception should be thrown");
74
75     this_test.done();
76 });
77
78 </script>
79 </body>
80 </html>