608ec1e008b488c3bc6eb7d1539445d2bdff9fb9
[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     Andrzej Krolikowski <a.krolikowsk@samsung.com>
22 -->
23 <html lang="en">
24
25 <head>
26 <title>MessageStorage_findFolders_filter_serviceId_folderPath</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_findFolders_filter_serviceId_folderPath
37 //==== LABEL check whether 'findFolders' method properly retrieves folders matching the supplied filter from MessageStorage (part 2)
38 //==== PRIORITY P2
39 //==== ONLOAD_DELAY 90
40 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:findFolders M
41 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html#findFoldersid2466935
42 //==== TEST_CRITERIA MOA MR
43 setup({timeout: 90000});
44
45 var t = async_test("MessageStorage_findFolders_filter_serviceId_folderPath", {timeout: 90000}),
46     serviceError, serviceSuccess, serviceIdFilter, folderPath, filter, findFoldersError, findFoldersSuccess,
47     returnedValue = null;
48
49 t.step(function () {
50     findFoldersSuccess = t.step_func(function (folders) {
51         assert_equals(returnedValue, undefined, "Incorrect returned value");
52         t.done();
53     });
54
55     findFoldersError = t.step_func(function (error) {
56         assert_unreached("findFolders() error callback: name:" + error.name + ", msg:" + error.message);
57     });
58
59     serviceSuccess = t.step_func(function (services) {
60         assert_greater_than(services.length, 0, "Received empty services array");
61
62         serviceIdFilter = new tizen.AttributeFilter("serviceId", "EXACTLY", "1");
63         folderPath = new tizen.AttributeFilter("path", "EXACTLY", "INBOX");
64         filter = new tizen.CompositeFilter("INTERSECTION", [serviceIdFilter, folderPath]);
65         returnedValue = services[0].messageStorage.findFolders(filter, findFoldersSuccess, findFoldersError);
66     });
67
68     serviceError = t.step_func(function (error) {
69         assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
70     });
71
72     tizen.messaging.getMessageServices("messaging.email", serviceSuccess, serviceError);
73 });
74
75 </script>
76 </body>
77 </html>