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.
19 Jakub Siewierski <j.siewierski@samsung.com>
24 <title>MessageService_mms_sendMessage_message_invalid_obj</title>
25 <meta charset="utf-8"/>
26 <script type="text/javascript" src="support/unitcommon.js"></script>
27 <script type="text/javascript" src="support/messaging_common.js"></script>
33 //==== TEST: MessageService_mms_sendMessage_message_invalid_obj
34 //==== LABEL Check if MessageService.sendMessage method throws exception when message is invalid (mms)
36 //==== SPEC Tizen Web API:Communication:Messaging:MessageService:sendMessage M
37 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
38 //==== ONLOAD_DELAY 90
39 //==== TEST_CRITERIA MTO
40 setup({timeout: 90000});
42 var t = async_test(document.title, {timeout: 90000}), messagingService, serviceSuccess, serviceError, sendSuccess,
43 sendError, fakeMessage, exceptionName = "TypeMismatchError";
46 sendSuccess = t.step_func(function (recipients) {
47 assert_unreached("Success callback invoked");
50 sendError = t.step_func(function (error) {
51 assert_unreached("Error callback invoked, name:" + error.name + ", msg:" + error.message);
54 serviceSuccess = t.step_func(function (services) {
55 assert_true(services.length > 0, "Received empty services array");
56 messagingService = services[0];
62 type: "messaging.mms",
65 to: [ TEST_SMS_RECIPIENT ],
69 plainBody: "Sample content"
80 { name: exceptionName },
82 messagingService.sendMessage(fakeMessage, sendSuccess, sendError);
84 exceptionName + " should be thrown - incorrectly created message."
90 serviceError = t.step_func(function (error) {
91 assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
94 tizen.messaging.getMessageServices("messaging.mms", serviceSuccess, serviceError);