bd3bfa36a80ba25e81f5fc513cb44cacd9cb2251
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2014 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         Zhao Dong<dong82.zhao@samsung.com>
19 -->
20 <html>
21 <head>
22 <title>MessageStorage_email_findConversations_filter_invalid_obj</title>
23 <meta charset="utf-8">
24 <script type="text/javascript" src="support/unitcommon.js"></script>
25 <script type="text/javascript" src="support/messaging_common.js"></script>
26 </head>
27 <body>
28 <div id="log"></div>
29 <script>
30 //==== TEST: MessageStorage_email_findConversations_filter_invalid_obj
31 //==== LABEL Check if MessageStorage::findConversations method throws exception when filter is invalid (email)
32 //==== PRIORITY P2
33 //==== ONLOAD_DELAY 90
34 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:findConversations M
35 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
36 //==== TEST_CRITERIA MTO
37
38 setup({timeout: 90000});
39
40 var t = async_test(document.title, {timeout: 90000}), findConversationsCallback, errorCallback, getMessagingServicesCallback,
41     onError, invalidFilter;
42
43 t.step(function () {
44
45     findConversationsCallback = t.step_func(function () {
46         assert_unreached("Unexpected findConversationsCallback");
47     });
48
49     errorCallback = t.step_func(function (err) {
50         assert_unreached("Unexpected errorCallback: " + err.message);
51     });
52
53     getMessagingServicesCallback = t.step_func(function (services) {
54         assert_not_equals(services.length, 0, "getMessageServices services.length");
55
56         invalidFilter = {
57             attributeName: "type",
58             matchFlag: "EXACTLY",
59             matchValue: services[0].type
60         };
61
62         assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
63             services[0].messageStorage.findConversations(invalidFilter, findConversationsCallback, errorCallback);
64         });
65
66         t.done();
67     });
68
69     onError = t.step_func(function (err) {
70         assert_unreached("Unexpected onError: " + err.message);
71     });
72
73     tizen.messaging.getMessageServices("messaging.email", getMessagingServicesCallback, onError);
74 });
75
76 </script>
77 </body>
78 </html>