3 Copyright (c) 2013 Samsung Electronics Co., Ltd.
5 Licensed under the Apache License, Version 2.0 (the License);
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
18 Zhao Dong<dong82.zhao@samsung.com>
23 <title>MessageStorage_removeChangeListener_forconversations_email</title>
24 <meta charset="utf-8">
25 <script type="text/javascript" src="support/unitcommon.js"></script>
26 <script type="text/javascript" src="support/messaging_common.js"></script>
31 //==== TEST: MessageStorage_removeChangeListener_forconversations_email
32 //==== LABEL Check if MessageStorage::removeChangeListener method works properly - for conversation listener (email)
34 //==== ONLOAD_DELAY 90
35 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:removeChangeListener M
36 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
37 //==== TEST_CRITERIA MR
39 setup({timeout: 90000});
41 var t = async_test(document.title, {timeout: 90000}),
42 listenerId, listener, serviceSuccess, serviceError, service, returnValue;
47 conversationsupdated: t.step_func(function (conversations) {
49 conversationsadded: t.step_func(function (conversations) {
51 conversationsremoved: t.step_func(function (conversations) {
55 serviceSuccess = t.step_func(function (services) {
56 assert_greater_than(services.length, 0, "Received empty services array");
57 service = services[0];
58 listenerId = service.messageStorage.addConversationsChangeListener(listener);
59 returnValue = service.messageStorage.removeChangeListener(listenerId);
60 assert_equals(returnValue, undefined, "Incorrect returned value.");
64 serviceError = t.step_func(function (error) {
65 assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
68 tizen.messaging.getMessageServices("messaging.email", serviceSuccess, serviceError);