ad39038d628fab1f4f5bf2750e4aca44471d9da7
[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         Karol Surma <k.surma@samsung.com>
22 -->
23 <html>
24 <head>
25 <title>MessageStorage_email_addFoldersChangeListener_foldersChangeCallback_TypeMismatch</title>
26 <meta charset="utf-8">
27 <script type="text/javascript" src="support/unitcommon.js"></script>
28 <script type="text/javascript" src="support/messaging_common.js"></script>
29 </head>
30
31 <body>
32 <div id="log"></div>
33 <script>
34
35 //==== TEST: MessageStorage_email_addFoldersChangeListener_foldersChangeCallback_TypeMismatch
36 //==== LABEL Check type conversions for foldersChangeCallback argument of MessageStorage.addFoldersChangeListener method (email)
37 //==== PRIORITY: P2
38 //==== ONLOAD_DELAY 180
39 //==== TIMEOUT 180
40 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:addFoldersChangeListener M
41 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
42 //==== TEST_CRITERIA MC
43 setup({timeout: 180000});
44
45 var t = async_test(document.title, {timeout: 180000}),
46     serviceSuccess, serviceError,
47     incorrectCallback, conversionTable, i, exceptionName;
48
49 t.step(function () {
50     serviceSuccess = t.step_func(function (service) {
51         conversionTable = getTypeConversionExceptions("object", false);
52
53         for(i = 0; i < conversionTable.length; i++) {
54             incorrectCallback = conversionTable[i][0];
55             exceptionName = conversionTable[i][1];
56
57             assert_throws({name: exceptionName}, function () {
58                 service.messageStorage.addFoldersChangeListener(incorrectCallback);
59             }, "Given incorrect error callback - " + incorrectCallback);
60         }
61
62         t.done();
63     });
64
65     serviceError = t.step_func(function (error) {
66         assert_unreached("getEmailService() error callback: name:" + error.name + ", msg:" + error.message);
67     });
68
69     getEmailService(t, serviceSuccess, serviceError);
70 });
71
72 </script>
73 </body>
74 </html>