4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
6 Licensed under the Apache License, Version 2.0 (the License);
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
21 Andrzej Krolikowski <a.krolikowsk@samsung.com>
27 <title>StatusNotification_constructor_notificationInitDict_partial</title>
28 <script src="support/unitcommon.js"></script>
29 <script src="support/notification_common.js"></script>
34 <script type="text/javascript">
36 //==== TEST: StatusNotification_constructor_notificationInitDict_partial
37 //==== LABEL Check if StatusNotification's constructor works with partial attributes in notificationInitDict
38 //==== SPEC Tizen Web API:User Interface:Notification:StatusNotification:constructor C
39 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/notification.html
41 //==== TEST_CRITERIA CONSTRM
44 var notificationDict, statusNotification, titleToSet = "Title",
45 contentToSet = "This is a simple notificaiton.", iconPathToSet = "images/webapi-tizen-notification-test_image1.jpg",
46 soundPathToSet = "music/webapi-tizen-notification-test_noise1.mp3", statusNotificationType = "SIMPLE";
49 content: contentToSet,
50 iconPath: iconPathToSet,
51 soundPath: soundPathToSet
53 statusNotification = new tizen.StatusNotification(statusNotificationType, titleToSet, notificationDict);
55 assert_true(statusNotification instanceof tizen.StatusNotification, "StatusNotification instanceOf.");
57 check_readonly(statusNotification, "type", "STATUS", "string", "dummyType");
58 check_readonly(statusNotification, "postedTime", undefined, "undefined", new Date());
59 assert_equals(statusNotification.title, titleToSet, "title attribute.");
60 assert_equals(statusNotification.content, contentToSet, "content attribute.");
61 assert_equals(statusNotification.statusType, statusNotificationType, "statusType attribute.");
62 assert_equals(statusNotification.iconPath, iconPathToSet, "iconPath attribute.");
63 assert_equals(statusNotification.subIconPath, null, "subIconPath attribute.");
64 assert_array_equals(statusNotification.detailInfo, [], "detailInfo attribute.");
65 assert_own_property(statusNotification, "ledColor", "statusNotification");
66 assert_equals(statusNotification.ledOnPeriod, 0, "statusNotification.ledOnPeriod");
67 assert_equals(statusNotification.ledOffPeriod, 0, "statusNotification.ledOffPeriod");
68 assert_equals(statusNotification.backgroundImagePath, null, "backgroundImagePath attribute.");
69 assert_equals(statusNotification.soundPath, soundPathToSet, "soundPath attribute.");
70 assert_equals(statusNotification.vibration, false, "vibration attribute.");
71 assert_equals(statusNotification.number, null, "number attribute.");
72 assert_equals(statusNotification.appControl, null, "appControl attribute.");
73 assert_equals(statusNotification.appId, null, "appId attribute.");
74 assert_equals(statusNotification.progressType, "PERCENTAGE", "progressType attribute.");
75 assert_equals(statusNotification.progressValue, null, "progressValue attribute.");
76 check_readonly(statusNotification, "id", undefined, "undefined", "dummyId");
77 assert_array_equals(statusNotification.thumbnails, [], " thumbnails attribute.");