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.
19 Beata Koziarek <b.koziarek@samsung.com>
25 <title>MessageStorage_removeConversations_with_errorCallback</title>
26 <script type="text/javascript" src="../resources/unitcommon.js"></script>
27 <script type="text/javascript" src="support/messaging_common.js"></script>
31 <script type="text/javascript">
32 //==== TEST: MessageStorage_removeConversations_with_errorCallback
33 //==== LABEL: Check if removeConversations method with optional errorCallback argument works
35 //==== SPEC: Tizen Web API:Communication:Messaging:MessageStorage:removeConversations M
36 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
37 //==== ONLOAD_DELAY 180
39 //==== TEST_CRITERIA MOA MR MAST
40 setup({timeout: 180000});
42 var t = async_test("MessageStorage_removeConversations_with_errorCallback", {timeout: 180000}),
43 removeSuccess, removeError, returnedValue = null, findFilter, findSuccessAfterRemove, findErrorAfterRemove;
45 message_conversation_test(t, function (service, message, conversation) {
47 findSuccessAfterRemove = t.step_func(function (conversations) {
48 assert_equals(conversations.length, 0, "Conversations not removed");
52 findErrorAfterRemove = t.step_func(function (error) {
53 assert_unreached("findConversations() error callback: name:" + error.name + ", msg:" + error.message);
56 removeSuccess = t.step_func(function () {
57 assert_equals(returnedValue, undefined, "Incorrect returned value");
59 findFilter = new tizen.AttributeFilter("id", "EXACTLY", message.conversationId);
60 service.messageStorage.findConversations(findFilter, findSuccessAfterRemove, findErrorAfterRemove);
63 removeError = t.step_func(function (error) {
64 assert_unreached("removeConversations() error callback: name:" + error.name + ", msg:" + error.message);
67 returnedValue = service.messageStorage.removeConversations([conversation], removeSuccess, removeError);