2e2eae36b1fc0483c46b8cab14eeeb4452f20e7f
[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 lang="en">
28
29 <head>
30 <title>ApplicationManager_launchAppControl_successCallback_TypeMismatch</title>
31 <meta charset="utf-8">
32 <script type="text/javascript" src="../resources/unitcommon.js"></script>
33 <script type="text/javascript" src="support/app_common.js"></script>
34 </head>
35
36 <body>
37 <div id="log"></div>
38 <script type="text/javascript">
39
40 //==== TEST: ApplicationManager_launchAppControl_successCallback_TypeMismatch
41 //==== LABEL check optional argument 'onSuccess' (launchAppControl) type conversion
42 //==== SPEC Tizen Web API:Application:Application:ApplicationManager:launchAppControl M
43 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/application.html
44 //==== STEP check optional argument 'onSuccess' (launchAppControl) type conversion
45 //==== EXPECT an exception must be thrown when the input value cannot be converted into a proper value
46 //==== EXECUTION_TYPE auto
47 //==== PRIORITY P2
48 //==== ONLOAD_DELAY 30
49 //==== TEST_CRITERIA MC
50
51 setup({timeout: 30000});
52
53 var t = async_test("ApplicationManager_launchAppControl_successCallback_TypeMismatch", { timeout : 30000 }),
54     i, appcontrol, conversionTable = getTypeConversionExceptions("functionObject", true);
55
56 setup_launch(t, TCT_APPCONTROL_APPID, function () {
57     appcontrol = new tizen.ApplicationControl(
58         TCT_APPCONTROL_LAUNCH_APPCONTROL_OPERATION
59     );
60
61     for (i = 0; i < conversionTable.length; i++) {
62         assert_throws({name: conversionTable[i][1]}, function () {
63             tizen.application.launchAppControl(appcontrol, null, conversionTable[i][0]);
64         }, "exception should be thrown");
65     }
66
67     assert_not_launch(t, TCT_APPCONTROL_APPID, function () {
68         t.done();
69     });
70 });
71
72 </script>
73 </body>
74 </html>