2499883ce3f0178679685e41af6da8b314a2e204
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2 <!--
3
4 Copyright (c) 2013 Samsung Electronics Co., Ltd.
5
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
9
10     http://www.apache.org/licenses/LICENSE-2.0
11
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.
17
18
19
20 Authors:
21         Andrzej Krolikowski <a.krolikowsk@samsung.com>
22
23 -->
24 <html>
25
26 <head>
27 <title>StatusNotification_constructor_notificationInitDict_partial</title>
28 <script src="support/unitcommon.js"></script>
29 <script src="support/notification_common.js"></script>
30 </head>
31
32 <body>
33 <div id="log"></div>
34 <script type="text/javascript">
35
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
40 //==== TEST_CRITERIA CONSTRM
41
42 test(function () {
43     var notificationDict, statusNotification, titleToSet = "Title",
44         contentToSet = "This is a simple notificaiton.", iconPathToSet = "images/webapi-tizen-notification-test_image1.jpg",
45         soundPathToSet = "music/webapi-tizen-notification-test_noise1.mp3", statusNotificationType = "SIMPLE";
46
47     notificationDict = {
48         content: contentToSet,
49         iconPath: iconPathToSet,
50         soundPath: soundPathToSet
51     };
52     statusNotification = new tizen.StatusNotification(statusNotificationType, titleToSet, notificationDict);
53
54     assert_true(statusNotification instanceof tizen.StatusNotification, "StatusNotification instanceOf.");
55
56     check_readonly(statusNotification, "type", "STATUS", "string", "dummyType");
57     check_readonly(statusNotification, "postedTime", undefined, "undefined", new Date());
58     assert_equals(statusNotification.title, titleToSet, "title attribute.");
59     assert_equals(statusNotification.content, contentToSet, "content attribute.");
60     assert_equals(statusNotification.statusType, statusNotificationType, "statusType attribute.");
61     assert_equals(statusNotification.iconPath, iconPathToSet, "iconPath attribute.");
62     assert_equals(statusNotification.subIconPath, null, "subIconPath attribute.");
63     assert_array_equals(statusNotification.detailInfo, [], "detailInfo attribute.");
64     assert_own_property(statusNotification, "ledColor", "statusNotification");
65     assert_equals(statusNotification.ledOnPeriod, 0, "statusNotification.ledOnPeriod");
66     assert_equals(statusNotification.ledOffPeriod, 0, "statusNotification.ledOffPeriod");
67     assert_equals(statusNotification.backgroundImagePath, null, "backgroundImagePath attribute.");
68     assert_equals(statusNotification.soundPath, soundPathToSet, "soundPath attribute.");
69     assert_equals(statusNotification.vibration, false, "vibration attribute.");
70     assert_equals(statusNotification.number, null, "number attribute.");
71     assert_equals(statusNotification.appControl, null, "appControl attribute.");
72     assert_equals(statusNotification.appId, null, "appId attribute.");
73     assert_equals(statusNotification.progressType, "PERCENTAGE", "progressType attribute.");
74     assert_equals(statusNotification.progressValue, null, "progressValue attribute.");
75     check_readonly(statusNotification, "id", undefined, "undefined", "dummyId");
76     assert_array_equals(statusNotification.thumbnails, [], " thumbnails attribute.");
77 }, document.title);
78
79 </script>
80 </body>
81 </html>