3 Copyright (c) 2012 Intel Corporation.
5 Redistribution and use in source and binary forms, with or without modification,
6 are permitted provided that the following conditions are met:
8 Redistributions of works must retain the original copyright notice, this list
9 of conditions and the following disclaimer.
10 Redistributions in binary form must reproduce the original copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13 Neither the name of Intel Corporation nor the names of its contributors
14 may be used to endorse or promote products derived from this work without
15 specific prior written permission.
17 THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION "AS IS"
18 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION BE LIABLE FOR ANY DIRECT,
21 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
24 OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 Li, Li <li.l.li@intel.com>
30 Zoe, Zou <zoex.zou@intel.com>
31 Ma,YueX <yuex.ma@intel.com>
37 <title>MessageStorage_email_addFoldersChangeListener_invalid_cb</title>
38 <script type="text/javascript" src="../resources/unitcommon.js"></script>
39 <script type="text/javascript" src="support/messaging_common.js"></script>
43 <script type="text/javascript">
44 //==== TEST: MessageStorage_email_addFoldersChangeListener_invalid_cb
45 //==== LABEL MessageStorage.addFoldersChangeListener with invalid callback (email)
47 //==== ONLOAD_DELAY 180
49 //==== SPEC Tizen Web API:Communication:Messaging:MessageStorage:addFoldersChangeListener M
50 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messaging.html
51 //==== TEST_CRITERIA MTL
52 setup({timeout: 180000});
54 var t = async_test("MessageStorage_email_addFoldersChangeListener_invalid_cb", {timeout: 180000}),
55 serviceSuccess, serviceError, incorrectListeners, folderChangeListener, i, exceptionName, filter;
58 serviceSuccess = t.step_func(function (service) {
59 filter = new tizen.AttributeFilter("serviceId", "EXACTLY", service.id);
61 incorrectListeners = getListenerConversionExceptions(["foldersadded", "foldersupdated", "foldersremoved"]);
63 for (i = 0; i < incorrectListeners.length; i++) {
64 folderChangeListener = incorrectListeners[i][0];
65 exceptionName = incorrectListeners[i][1];
67 assert_throws({name : exceptionName},
69 service.messageStorage.addFoldersChangeListener(folderChangeListener, filter);
70 }, exceptionName + " should be thrown - given incorrect successCallback.");
76 serviceError = t.step_func(function (error) {
77 assert_unreached("getEmailService() error callback: name:" + error.name + ", msg:" + error.message);
80 getEmailService(t, serviceSuccess, serviceError);