f4a73b51d99c5ad17350d55854ccf3adc89e8331
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2
3 <!--
4
5 Copyright (c) 2016 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 Authors:
20         Xiaoyan Qian <xy.qian@samsung.com>
21
22 -->
23 <html>
24 <head>
25 <title>ApplicationManager_kill_errorCallback_invoked_InvalidValuesError</title>
26 <meta charset="utf-8">
27 <script src="support/unitcommon.js"></script>
28 <script src="support/app_common.js"></script>
29 </head>
30 <body>
31 <div id="log"></div>
32 <script>
33 //==== TEST: ApplicationManager_kill_errorCallback_invoked_InvalidValuesError
34 //==== LABEL Check exception in error callback of kill() method
35 //==== ONLOAD_DELAY 30
36 //==== SPEC Tizen Web API:Application:Application:ApplicationManager:kill M
37 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/application.html
38 //==== PRIORITY P2
39 //==== TEST_CRITERIA MERRCB
40
41 setup({timeout: 30000});
42
43 var t = async_test(document.title, {timeout: 30000}), killSuccess, killError, currentApplication;
44
45 t.step(function () {
46     killSuccess = t.step_func(function () {
47         assert_unreached("This function should not be used");
48     });
49
50     killError = t.step_func(function (error) {
51         assert_equals(error.name, "InvalidValuesError", "InvalidValuesError must be thrown");
52         t.done();
53     });
54
55     currentApplication = tizen.application.getCurrentApplication();
56
57     tizen.application.kill(currentApplication.contextId, killSuccess, killError);
58 });
59
60 </script>
61 </body>
62 </html>