5f897e33e84c50b06b9b49f704c71965589dca63
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3
4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
5
6 Licensed under the Apache License, Version 2.0 (the License);
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10     http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 Authors:
19         Beata Koziarek <b.koziarek@samsung.com>
20
21 -->
22
23 <html>
24 <head>
25 <title>MessageStorage_removeConversations_successCallback_invalid_cb</title>
26 <script type="text/javascript" src="support/unitcommon.js"></script>
27 <script type="text/javascript" src="support/messaging_common.js"></script>
28 </head>
29 <body>
30 <div id="log"></div>
31 <script type="text/javascript">
32 //==== TEST: MessageStorage_removeConversations_successCallback_invalid_cb
33 //==== LABEL Check if MessageStorage.removeConversations method throws exception when successCallback is invalid
34 //==== PRIORITY: P2
35 //==== ONLOAD_DELAY 300
36 //==== TIMEOUT 300
37 //==== SPEC: Tizen Web API:Communication:Messaging:MessageStorage:removeConversations M
38 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
39 //==== TEST_CRITERIA MTCB
40 setup({timeout: 90000});
41
42 var t = async_test(document.title, {timeout: 90000}),
43     incorrectSuccessCallback, exceptionName = "TypeMismatchError";
44
45 message_conversation_test(t, function (service, message, conversation) {
46
47     incorrectSuccessCallback = {
48         onsuccess: t.step_func(function () {
49             assert_unreached("removeConversations() success callback invoked.");
50         })
51     };
52
53     assert_throws({name: exceptionName}, function () {
54         service.messageStorage.removeConversations([conversation], incorrectSuccessCallback);
55     }, exceptionName + " should be thrown - given incorrect successCallback.");
56
57     t.done();
58 });
59
60 </script>
61 </body>
62 </html>