2fe340af88698850456c12e2f28300df2f91a827
[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 lang="en">
25
26 <head>
27 <title>MessageStorage_sms_findConversations_filter_invalid_obj</title>
28 <meta charset="utf-8">
29 <script type="text/javascript" src="../resources/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_invalid_obj
38 //==== LABEL Check whether method MessageStorage::findConversations() method generic object as filter param throws exception properly
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#findConversationsid2466491
43 //==== TEST_CRITERIA MTO
44 setup({timeout: 90000});
45
46 var this_test = async_test("MessageStorage_sms_findConversations_filter_invalid_obj", {timeout: 90000});
47 this_test.step(function () {
48     var findConversationsCallback, errorCallback, getMessagingServicesCallback,
49         onError, invalidFilter;
50
51     findConversationsCallback = this_test.step_func(function () {
52         assert_unreached("Unexpected findConversationsCallback");
53     });
54
55     errorCallback = this_test.step_func(function (err) {
56         assert_unreached("Unexpected errorCallback: " + err.message);
57     });
58
59
60     getMessagingServicesCallback = this_test.step_func(function (services) {
61         assert_not_equals(services.length, 0, "getMessageServices services.length");
62
63         invalidFilter = {
64             attributeName: "type",
65             matchFlag: "EXACTLY",
66             matchValue: services[0].type
67         };
68
69         assert_throws({
70             name: TYPE_MISMATCH_ERR
71         }, function () {
72             services[0].messageStorage.findConversations(invalidFilter, findConversationsCallback, errorCallback);
73         });
74
75         return this_test.done();
76     });
77
78     onError = this_test.step_func(function (err) {
79         assert_unreached("Unexpected onError: " + err.message);
80     });
81
82     tizen.messaging.getMessageServices("messaging.sms", getMessagingServicesCallback, onError);
83 });
84
85 </script>
86 </body>
87 </html>