| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Notifications: Check that showNotifications rejects if actions is set
incorrectly.</title> | 4 <title>Notifications: Check that showNotifications rejects if actions is set
incorrectly.</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 <script src="../serviceworker/resources/test-helpers.js"></script> | 7 <script src="../serviceworker/resources/test-helpers.js"></script> |
| 8 <script src="resources/test-helpers.js"></script> | 8 <script src="resources/test-helpers.js"></script> |
| 9 </head> | 9 </head> |
| 10 <body> | 10 <body> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 async_test(function(test) { | 35 async_test(function(test) { |
| 36 var scope = 'resources/scope/' + location.pathname + "/emptytitle"; | 36 var scope = 'resources/scope/' + location.pathname + "/emptytitle"; |
| 37 | 37 |
| 38 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(workerInfo) { | 38 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(workerInfo) { |
| 39 assert_inherits(workerInfo.registration, 'showNotification', 'show
Notification() must be exposed.'); | 39 assert_inherits(workerInfo.registration, 'showNotification', 'show
Notification() must be exposed.'); |
| 40 | 40 |
| 41 workerInfo.registration.showNotification('Title', { | 41 workerInfo.registration.showNotification('Title', { |
| 42 actions: [{title: ""}] | 42 actions: [{title: ""}] |
| 43 }).then(unreached_fulfillment(test)).catch(function(error) { | 43 }).then(unreached_fulfillment(test)).catch(function(error) { |
| 44 assert_equals(error.name, 'TypeError'); | 44 assert_equals(error.name, 'TypeError'); |
| 45 assert_equals(error.message, 'Notification action titles must
not be empty.'); | 45 assert_equals(error.message, "Failed to execute 'showNotificat
ion' on 'ServiceWorkerRegistration': Notification action titles must not be empt
y."); |
| 46 test.done(); | 46 test.done(); |
| 47 }); | 47 }); |
| 48 }).catch(unreached_rejection(test)); | 48 }).catch(unreached_rejection(test)); |
| 49 | 49 |
| 50 }, 'showNotification() must reject if an action has an empty title.'); | 50 }, 'showNotification() must reject if an action has an empty title.'); |
| 51 </script> | 51 </script> |
| 52 </body> | 52 </body> |
| 53 </html> | 53 </html> |
| OLD | NEW |