b7cedfe07b26f19c4e59eec75a196436f13f855d
[test/tct/web/api.git] /
1 <!DOCTYPE html>
2
3 <!--
4
5 Copyright (c) 2017 Samsung Electronics Co., Ltd.
6
7 Licensed under the Apache License, Version 2.0 (the License);
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11     http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19 Authors:
20         Xiaoyan Qian <xy.qian@samsung.com>
21
22 -->
23
24 <html>
25 <head>
26 <title>NotificationManager_createNotificationFromTemplate</title>
27 <meta charset="utf-8">
28 <script src="support/unitcommon.js"></script>
29 </head>
30 <body>
31 <div id="log"></div>
32 <script>
33
34 //==== TEST: NotificationManager_createNotificationFromTemplate
35 //==== LABEL Check if NotificationManager createNotificationFromTemplate method works properly
36 //==== SPEC Tizen Web API:Application:Notification:NotificationManager:createNotificationFromTemplate M
37 //==== SPEC_URL TBD
38 //==== PRIORITY P1
39 //==== TEST_CRITERIA MR
40
41 test(function () {
42     add_result_callback(function () {
43         try {
44             tizen.notification.removeAll();
45         } catch (err) {
46             // do nothing in case removeAll throw an exception
47         }
48     });
49
50     var notificationDict, notification, retVal;
51     notificationDict = {
52         content: "This is a simple notification.",
53         iconPath: "images/webapi-tizen-notification-test_image1.jpg",
54         soundPath: "music/webapi-tizen-notification-test_noise1.mp3"
55     };
56     notification = new tizen.StatusNotification("SIMPLE", "Simple notification", notificationDict);
57     tizen.notification.saveNotificationAsTemplate("SIMPLE_TEMPLATE", notification);
58     retVal = tizen.notification.createNotificationFromTemplate("SIMPLE_TEMPLATE");
59     assert_true(retVal instanceof tizen.StatusNotification, "object was not get properly");
60 }, document.title);
61
62 </script>
63 </body>
64 </html>