OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Notifications: The Notification object exposes the expected propertie
s.</title> | 4 <title>Notifications: The Notification object exposes the expected propertie
s.</title> |
5 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
6 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <script> | 9 <script> |
10 // Tests that the Notification object exposes the properties per the | 10 // Tests that the Notification object exposes the properties per the |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Invalid icon URLs should be reset to an empty string. | 51 // Invalid icon URLs should be reset to an empty string. |
52 assert_equals(invalidIconNotification.icon, ""); | 52 assert_equals(invalidIconNotification.icon, ""); |
53 | 53 |
54 var serializedUrlNotification = new Notification("My Notification",
{ | 54 var serializedUrlNotification = new Notification("My Notification",
{ |
55 icon: "http://example.com" | 55 icon: "http://example.com" |
56 }); | 56 }); |
57 | 57 |
58 // Icon URLs should be returned in serialized form. | 58 // Icon URLs should be returned in serialized form. |
59 assert_equals(serializedUrlNotification.icon, "http://example.com/")
; | 59 assert_equals(serializedUrlNotification.icon, "http://example.com/")
; |
60 | 60 |
| 61 var invalidLanguageNotification = new Notification("My Notification"
, { |
| 62 lang: "invalid language" |
| 63 }); |
| 64 |
| 65 // Invalid languages should be reset to an empty string. |
| 66 assert_equals(invalidLanguageNotification.lang, ""); |
| 67 |
61 var noTagNotification = new Notification("My Notification"), | 68 var noTagNotification = new Notification("My Notification"), |
62 emptyTagNotification = new Notification("My Notification", { tag
: "" }); | 69 emptyTagNotification = new Notification("My Notification", { tag
: "" }); |
63 | 70 |
64 // Setting an empty string as the tag should be equal to not setting
the tag at all. | 71 // Setting an empty string as the tag should be equal to not setting
the tag at all. |
65 assert_equals(noTagNotification.tag, emptyTagNotification.tag); | 72 assert_equals(noTagNotification.tag, emptyTagNotification.tag); |
66 | 73 |
67 var vibrateNotification = new Notification("My Notification", { | 74 var vibrateNotification = new Notification("My Notification", { |
68 vibrate: 1000 | 75 vibrate: 1000 |
69 }); | 76 }); |
70 | 77 |
(...skipping 18 matching lines...) Expand all Loading... |
89 var notification = new Notification("My Notification", { | 96 var notification = new Notification("My Notification", { |
90 silent: true, | 97 silent: true, |
91 vibrate: 1000 | 98 vibrate: 1000 |
92 }); | 99 }); |
93 }, 'Set vibrate, when silent is true.'); | 100 }, 'Set vibrate, when silent is true.'); |
94 | 101 |
95 }, 'Checks the properties exposed on the Notification object.'); | 102 }, 'Checks the properties exposed on the Notification object.'); |
96 </script> | 103 </script> |
97 </body> | 104 </body> |
98 </html> | 105 </html> |
OLD | NEW |