963bbf8fcc3b04c69865134623165f8e9af3b01f
[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
19
20 Authors:
21         Piotr Szydelko <p.szydelko@samsung.com>
22
23 -->
24 <html>
25
26 <head>
27 <title>MessageStorage_sms_findConversations_filter_TypeMismatch</title>
28 <meta charset="utf-8">
29 <script type="text/javascript" src="support/unitcommon.js"></script>
30 <script type="text/javascript" src="support/messaging_common.js"></script>
31 </head>
32
33 <body>
34 <div id="log"></div>
35 <script>
36
37 //==== TEST: MessageStorage_sms_findConversations_filter_TypeMismatch
38 //==== LABEL Check type conversions for filter argument of MessageStorage.findConversations method (sms)
39 //==== PRIORITY P2
40 //==== ONLOAD_DELAY 90
41 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:findConversations M
42 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
43 //==== TEST_CRITERIA MC
44 setup({timeout: 90000});
45
46 var t = async_test(document.title, {timeout: 90000}), findConversationsCallback, errorCallback, getMessagingServicesCallback,
47     onError, i, incorrectFilter, conversionTable, exceptionName;
48 t.step(function () {
49
50     findConversationsCallback = t.step_func(function () {
51         assert_unreached("Unexpected findConversationsCallback");
52     });
53
54     errorCallback = t.step_func(function (err) {
55         assert_unreached("Unexpected errorCallback: " + err.message);
56     });
57
58     getMessagingServicesCallback = t.step_func(function (services) {
59         assert_not_equals(services.length, 0, "getMessageServices services.length");
60
61         conversionTable = getTypeConversionExceptions("object", false);
62
63         for (i = 0; i < conversionTable.length; i++) {
64             incorrectFilter = conversionTable[i][0];
65             exceptionName = conversionTable[i][1];
66
67             assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
68                 services[0].messageStorage.findConversations(incorrectFilter, findConversationsCallback, errorCallback);
69             });
70         }
71         t.done();
72     });
73
74     onError = t.step_func(function (err) {
75         assert_unreached("Unexpected onError: " + err.message);
76     });
77
78     tizen.messaging.getMessageServices("messaging.sms", getMessagingServicesCallback, onError);
79 });
80
81 </script>
82 </body>
83 </html>