b5802bc0df8f1b99f666a89373d4e7c75c61a1cc
[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_with_filter</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_with_filter
36 //==== LABEL Check if MessageStorage.addFoldersChangeListener method works properly with filter (email)
37 //==== PRIORITY P1
38 //==== ONLOAD_DELAY 300
39 //==== TIMEOUT 300
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 MOA MR
43 setup({timeout: 90000});
44
45 var t = async_test(document.title, {timeout: 90000}),
46     serviceSuccess, serviceError, foldersChangeCallback, watchId, filter;
47 t.step(function () {
48
49     foldersChangeCallback = {
50         foldersupdated: t.step_func(function (updatedFolders){
51         }),
52         foldersadded: t.step_func(function (addedFolders){
53         }),
54         foldersremoved: t.step_func(function (removedFolders){
55         })
56     };
57
58     serviceSuccess = t.step_func(function (service) {
59         filter = new tizen.AttributeFilter("serviceId", "EXACTLY", service.id);
60
61         watchId = service.messageStorage.addFoldersChangeListener(foldersChangeCallback, filter);
62         assert_type(watchId, "long", "Incorrect returned type");
63
64         service.messageStorage.removeChangeListener(watchId);
65
66         t.done();
67     });
68
69     serviceError = t.step_func(function (error) {
70         assert_unreached("getEmailService() error callback: name:" + error.name + ", msg:" + error.message);
71     });
72
73     getEmailService(t, serviceSuccess, serviceError);
74 });
75
76 </script>
77 </body>
78 </html>