060adf66d8ef7a8af3d6511645bc7c6986e3f68d
[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_getAppsContext_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 </head>
35
36 <body>
37 <div id="log"></div>
38 <script type="text/javascript">
39
40 //==== TEST: ApplicationManager_getAppsContext_errorCallback_invalid_cb
41 //==== LABEL check if an exception was thrown when a fake callback (onerror) was passed into getAppsContext method
42 //==== ONLOAD_DELAY 30
43 //==== SPEC Tizen Web API:Application:Application:ApplicationManager:getAppsContext M
44 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/application.html
45 //==== PRIORITY P2
46 //==== TEST_CRITERIA MTCB
47
48 setup({timeout: 30000});
49
50 var this_test = async_test("ApplicationManager_getAppsContext_errorCallback_invalid_cb", {timeout: 30000});
51 this_test.step(function () {
52     var getSuccess, getError, getErrorFunc;
53
54     getSuccess = this_test.step_func(function () {
55         assert_unreached("application should not be run");
56     });
57
58     getErrorFunc = this_test.step_func(function (error) {
59         assert_unreached("getAppsContext() error callback invoked: name:" + error.name + "msg:" + error.message);
60     });
61
62     getError = {
63         onerror: getErrorFunc
64     };
65
66     assert_throws({name: "TypeMismatchError"}, function () {
67         tizen.application.getAppsContext(getSuccess, getError);
68     }, "exception should be thrown");
69
70     this_test.done();
71
72 });
73
74 </script>
75 </body>
76 </html>