30e4881df3ed3f6d0a8d53f3a21c90a7ba4238a0
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 Samsung Electronics Co., Ltd.
4
5 Licensed under the Apache License, Version 2.0 (the License);
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 Authors:
18         Krzysztof Lachacz <k.lachacz@samsung.com>
19
20 -->
21
22 <html>
23 <head>
24 <title>CallHistory_removeBatch_successCallback_undefined</title>
25 <script src="support/unitcommon.js"></script>
26 <script src="support/callcommon.js"></script>
27 </head>
28
29 <body>
30 <div id="log"></div>
31 <script type="text/javascript">
32 //==== TEST: CallHistory_removeBatch_successCallback_undefined
33 //==== LABEL Check whether removeBatch() method called with undefined successCallback throws exception
34 //==== EXECUTION_TYPE manual
35 //==== PRIORITY P2
36 //==== SPEC Tizen Web API:Social:Callhistory:CallHistory:removeBatch M
37 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/callhistory.html
38 //==== TEST_CRITERIA MC
39 //==== PRE Make at least 3 existence call history
40
41 setup({timeout: 90000});
42
43 var t = async_test(document.title, {timeout: 90000}),
44     findSuccess, findError, removeBatchError, list, exceptionName = "TypeMismatchError";
45
46 t.step(function () {
47     removeBatchError = t.step_func(function (error) {
48         assert_unreached("removeBatch() error callback invoked: name: " + error.name + ", msg: " + error.message);
49     });
50
51     findError = t.step_func(function (error) {
52         assert_unreached("find() error callback invoked: name: " + error.name + ", msg: " + error.message);
53     });
54
55     findSuccess = t.step_func(function (results) {
56         assert_type(results, "array", "Results should be an array");
57         assert_true(results.length > 2, "Expected 3 calls in history at least, but found: " + results.length);
58         list = [results[0], results[1]];
59
60         assert_throws({ name: exceptionName },
61             function () {
62                 tizen.callhistory.removeBatch(list, undefined, removeBatchError);
63             }, exceptionName + " should be thrown");
64
65         t.done();
66     });
67
68     tizen.callhistory.find(findSuccess, findError);
69 });
70
71 </script>
72 </body>
73 </html>