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_sms_findConversations_errorCallback_TypeMismatch</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_sms_findConversations_errorCallback_TypeMismatch
37 //==== LABEL check whether invoking 'findConversations' method with invalid error callback throws exception properly
39 //==== ONLOAD_DELAY 90
40 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:findConversations M
41 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html#findConversationsid2466491
42 //==== TEST_CRITERIA MC
43 setup({timeout: 90000});
45 var this_test = async_test("MessageStorage_sms_findConversations_errorCallback_TypeMismatch", {timeout: 90000});
46 this_test.step(function () {
47 var toFilter, findConversationsCallback, getMessagingServicesCallback,
48 onError, i, incorrectCallback, conversionTable, exceptionName;
50 toFilter = new tizen.AttributeFilter("to", "CONTAINS", TEST_SMS_RECIPIENT);
52 findConversationsCallback = this_test.step_func(function () {
53 assert_unreached("Unexpected findConversationsCallback");
56 getMessagingServicesCallback = this_test.step_func(function (services) {
57 assert_true(services.length > 0, "services not found");
59 conversionTable = getTypeConversionExceptions("functionObject", true);
61 for (i = 0; i < conversionTable.length; i++) {
62 incorrectCallback = conversionTable[i][0];
63 exceptionName = conversionTable[i][1];
68 services[0].messageStorage.findConversations(toFilter, findConversationsCallback, incorrectCallback);
71 return this_test.done();
74 onError = this_test.step_func(function (err) {
75 assert_unreached("Unexpected onError: " + err.message);
78 tizen.messaging.getMessageServices("messaging.sms", getMessagingServicesCallback, onError);