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 Karol Surma <k.surma@samsung.com>
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>
35 //==== TEST: MessageStorage_email_addFoldersChangeListener_with_filter
36 //==== LABEL Check if MessageStorage.addFoldersChangeListener method works properly with filter (email)
38 //==== ONLOAD_DELAY 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});
45 var t = async_test(document.title, {timeout: 90000}),
46 serviceSuccess, serviceError, foldersChangeCallback, watchId, filter;
49 foldersChangeCallback = {
50 foldersupdated: t.step_func(function (updatedFolders){
52 foldersadded: t.step_func(function (addedFolders){
54 foldersremoved: t.step_func(function (removedFolders){
58 serviceSuccess = t.step_func(function (service) {
59 filter = new tizen.AttributeFilter("serviceId", "EXACTLY", service.id);
61 watchId = service.messageStorage.addFoldersChangeListener(foldersChangeCallback, filter);
62 assert_type(watchId, "long", "Incorrect returned type");
64 service.messageStorage.removeChangeListener(watchId);
69 serviceError = t.step_func(function (error) {
70 assert_unreached("getEmailService() error callback: name:" + error.name + ", msg:" + error.message);
73 getEmailService(t, serviceSuccess, serviceError);