c8a72bd3e2ebf048a5a2f5d505819b66a71e73ae
[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
22 -->
23 <html lang="en">
24
25 <head>
26 <title>Messaging/UTC_messaging</title>
27 <meta charset="utf-8">
28 <script type="text/javascript" src="../resources/unitcommon.js"></script>
29 <script type="text/javascript" src="support/messaging_common.js"></script>
30 </head>
31
32 <body>
33 <div id="log"></div>
34 <script>
35
36 //==== TEST: MessageStorage_findMessages_successCallback_TypeMismatch_undefined
37 //==== LABEL check whether invoking 'findMessages' method with undefined success callback throws exception properly
38 //==== STEP check whether invoking 'findMessages' method with undefined success callback throws exception properly
39 //==== EXPECT Pass
40 //==== PRIORITY P2
41 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:findMessages M
42 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html#findMessagesid2465847
43 //==== TEST_CRITERIA MC
44
45 var this_test = async_test("MessageStorage_findMessages_successCallback_TypeMismatch_undefined");
46 this_test.step(function () {
47     var testName, typeFilter, errorCallback, getMessagingServicesCallback, onError;
48
49     testName = "findMessages test Argument 1, Invaild Test 02 : input [undefined] to argument 1";
50
51     typeFilter = new tizen.AttributeFilter("type", "EXACTLY", "messaging.sms");
52
53     errorCallback = this_test.step_func(function (err) {
54         // nop function
55     });
56
57     getMessagingServicesCallback = this_test.step_func(function (services) {
58         assert_true(services.length > 0, "services not found");
59         assert_throws({
60             name: TYPE_MISMATCH_ERR
61         }, function () {
62             services[0].messageStorage.findMessages(typeFilter, undefined, errorCallback);
63         });
64         return this_test.done();
65     });
66
67     onError = this_test.step_func(function (err) {
68         assert_unreached("Unexpected onError: " + err.message);
69     });
70
71     tizen.messaging.getMessageServices("messaging.sms", getMessagingServicesCallback, onError);
72 });
73
74 </script>
75 </body>
76 </html>