3 Copyright (c) 2015 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.
18 Wangxiao Chun <xiaochn.wang@samsung.com>
19 Xiaoyan Qian <xy.qian@samsung.com>>
24 <title>Application_addEventListener_callback_TypeMismatch</title>
25 <meta charset="utf-8"/>
26 <script src="support/unitcommon.js"></script>
27 <script src="support/app_common.js"></script>
32 //==== TEST: Application_addEventListener_callback_TypeMismatch
33 //==== LABEL Check if Application::addEventListener throws exception when given wrong eventCallback
34 //==== SPEC Tizen Web API:TBD:Application:Application:addEventListener M
35 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/application.html
37 //==== TEST_CRITERIA MC
40 var app = tizen.application.getCurrentApplication(), i, badValues, value, exceptionName;
42 badValues = getTypeConversionExceptions("functionObject", false);
43 for (i = 0; i < badValues.length; i++) {
44 value = badValues[i][0];
45 exceptionName = badValues[i][1];
49 app.addEventListener({"appId": app.appInfo.id, "name": APP_BROAD_TEST_APP_NAME}, value);
50 }, exceptionName + " exception should be thrown with an invalid name.");