3 Copyright (c) 2016 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 Wei Ji <wei.ji@samsung.com>
24 <title>Widget_addStateChangeListener_callback_TypeMismatch</title>
25 <meta charset="utf-8"/>
26 <script src="support/unitcommon.js"></script>
31 //==== TEST: Widget_addStateChangeListener_callback_TypeMismatch
32 //==== LABEL Check if addStateChangeListener() with incorrect callback argument throws an exception
33 //==== SPEC Tizen Web API:TBD:WidgetService:Widget:addStateChangeListener M
36 //==== TEST_CRITERIA MC
39 var callback, i, conversionTable, exceptionName, id, myWidget;
41 id = "apiwidserv.widget3";
42 myWidget = tizen.widgetservice.getWidget(id);
43 conversionTable = getTypeConversionExceptions("functionObject", false);
44 for (i = 0; i < conversionTable.length; i++) {
45 callback = conversionTable[i][0];
46 exceptionName = conversionTable[i][1];
48 assert_throws({name: exceptionName}, function () {
49 myWidget.addStateChangeListener(callback);
50 }, "Given incorrect callback.");