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_email_sendMessage_successCallback_invalid_cb</title>
25 <script src="../resources/unitcommon.js"></script>
26 <script src="support/messaging_common.js"></script>
32 //==== TEST: MessageService_email_sendMessage_successCallback_invalid_cb
33 //==== LABEL Check argument MessageService.sendMessage (email) successCallback validation - use {onsuccess: function(){}}
35 //==== SPEC Tizen Web API:Communication:Messaging:MessageService:sendMessage M
36 //==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/messaging.html
37 //==== ONLOAD_DELAY 180
39 //==== TEST_CRITERIA MTCB
40 setup({ timeout: 180000 });
42 var t = async_test("MessageService_email_sendMessage_successCallback_invalid_cb", { timeout: 180000 }),
43 serviceSuccess, serviceError, message,
44 sendError, invalidSuccessCallback,exceptionName = "TypeMismatchError";
47 invalidSuccessCallback = {
48 onsuccess: t.step_func(function (recipients) {
49 assert_unreached("Invalid success callback invoked");
53 sendError = t.step_func(function (error) {
54 assert_unreached("Error callback invoked, name:" + error.name + ", msg:" + error.message);
57 serviceSuccess = t.step_func(function (service) {
59 message = createSimpleMessageTo(TEST_EMAIL_RECIPIENT_2);
62 { name: exceptionName },
64 service.sendMessage(message, invalidSuccessCallback, sendError);
66 exceptionName + " should be thrown - invalid success callback."
72 serviceError = t.step_func(function (error) {
73 assert_unreached("getMessageServices() error callback: name:" + error.name + ", msg:" + error.message);
76 getEmailService(t, serviceSuccess, serviceError);