4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
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
10 http://www.apache.org/licenses/LICENSE-2.0
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.
21 Andrzej Krolikowski <a.krolikowsk@samsung.com>
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>
36 //==== TEST: MessageStorage_findFolders_filter_serviceId_folderPath
37 //==== LABEL check whether 'findFolders' method properly retrieves folders matching the supplied filter from MessageStorage (part 2)
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});
45 var t = async_test("MessageStorage_findFolders_filter_serviceId_folderPath", {timeout: 90000}),
46 serviceError, serviceSuccess, serviceIdFilter, folderPath, filter, findFoldersError, findFoldersSuccess,
50 findFoldersSuccess = t.step_func(function (folders) {
51 assert_equals(returnedValue, undefined, "Incorrect returned value");
55 findFoldersError = t.step_func(function (error) {
56 assert_unreached("findFolders() error callback: name:" + error.name + ", msg:" + error.message);
59 serviceSuccess = t.step_func(function (services) {
60 assert_greater_than(services.length, 0, "Received empty services array");
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);
68 serviceError = t.step_func(function (error) {
69 assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
72 tizen.messaging.getMessageServices("messaging.email", serviceSuccess, serviceError);