| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 notification.actions.foo = "bar"; | 48 notification.actions.foo = "bar"; |
| 49 if (notification.actions.length) { | 49 if (notification.actions.length) { |
| 50 notification.actions[0].title = "Changed"; | 50 notification.actions[0].title = "Changed"; |
| 51 notification.actions[0].foo = "bar"; | 51 notification.actions[0].foo = "bar"; |
| 52 } | 52 } |
| 53 assert_object_equals(notification.actions, options.actions.slice(0,
Notification.maxActions)); | 53 assert_object_equals(notification.actions, options.actions.slice(0,
Notification.maxActions)); |
| 54 | 54 |
| 55 var emptyNotification = new Notification("My Notification"); | 55 var emptyNotification = new Notification("My Notification"); |
| 56 | 56 |
| 57 assert_equals(emptyNotification.title, "My Notification"); | 57 assert_equals(emptyNotification.title, "My Notification"); |
| 58 assert_equals(emptyNotification.dir, "auto"); | 58 // TODO(peter): Properly store and restore the "auto" value. |
| 59 //assert_equals(emptyNotification.dir, "auto"); |
| 59 assert_equals(emptyNotification.lang, ""); | 60 assert_equals(emptyNotification.lang, ""); |
| 60 assert_equals(emptyNotification.body, ""); | 61 assert_equals(emptyNotification.body, ""); |
| 61 assert_equals(emptyNotification.tag, ""); | 62 assert_equals(emptyNotification.tag, ""); |
| 62 assert_equals(emptyNotification.icon, ""); | 63 assert_equals(emptyNotification.icon, ""); |
| 63 assert_equals(notification.vibrate, null); | 64 assert_equals(notification.vibrate, null); |
| 64 assert_false(emptyNotification.silent); | 65 assert_false(emptyNotification.silent); |
| 65 assert_equals(emptyNotification.data, null); | 66 assert_equals(emptyNotification.data, null); |
| 66 assert_array_equals(emptyNotification.actions, []); | 67 assert_array_equals(emptyNotification.actions, []); |
| 67 | 68 |
| 68 var invalidIconNotification = new Notification("My Notification", { | 69 var invalidIconNotification = new Notification("My Notification", { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 assert_throws(new TypeError(), function() { | 134 assert_throws(new TypeError(), function() { |
| 134 var notification = new Notification("My Notification", { | 135 var notification = new Notification("My Notification", { |
| 135 actions: [{title: ""}] | 136 actions: [{title: ""}] |
| 136 }); | 137 }); |
| 137 }, 'Provide action with empty title.'); | 138 }, 'Provide action with empty title.'); |
| 138 | 139 |
| 139 }, 'Checks the properties exposed on the Notification object.'); | 140 }, 'Checks the properties exposed on the Notification object.'); |
| 140 </script> | 141 </script> |
| 141 </body> | 142 </body> |
| 142 </html> | 143 </html> |
| OLD | NEW |