f27fa5497d232775c75d61f70d413a420404f975
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3 Copyright (c) 2013 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
18 Authors:
19     Andrzej Krolikowski <a.krolikowsk@samsung.com>
20
21 -->
22 <html lang="en">
23 <head>
24 <title>MessageStorage_email_addMessagesChangeListener_missarg</title>
25 <meta charset="utf-8"/>
26 <script type="text/javascript" src="../resources/unitcommon.js"></script>
27 <script type="text/javascript" src="support/messaging_common.js"></script>
28 </head>
29
30 <body>
31 <div id="log"></div>
32 <script>
33 //==== TEST: MessageStorage_email_addMessagesChangeListener_missarg
34 //==== LABEL Check with missing non-optional argument - addMessagesChangeListener, email
35 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:addMessagesChangeListener M
36 //==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/messaging.html
37 //==== ONLOAD_DELAY 90
38 //==== TEST_CRITERIA MMA
39 setup({timeout: 180000});
40 var t = async_test("MessageStorage_email_addMessagesChangeListener_missarg", {timeout:180000});
41 t.step(function () {
42     var serviceSuccess, serviceError, messageService, messageStorage, exceptionName = "TypeMismatchError";
43
44     serviceSuccess = t.step_func(function (services) {
45         assert_true(services.length > 0, "Received empty services array");
46         messageService = services[0];
47         messageStorage = messageService.messageStorage;
48
49         assert_throws({name : exceptionName},
50             function () {
51                 messageStorage.addMessagesChangeListener();
52             }, exceptionName + " should be thrown - missing argument.");
53         t.done();
54     });
55
56     serviceError = t.step_func(function (error) {
57         assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
58     });
59     tizen.messaging.getMessageServices("messaging.email", serviceSuccess, serviceError);
60 });
61 </script>
62 </body>
63 </html>