| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Notifications: Showing a notification with an image that 404s.</title
> | 4 <title>Notifications: Showing a notification with an image that has a redire
ct loop still succeeds.</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> |
| 11 <script> | 11 <script> |
| 12 // Tests that showing a notification with an image that creates a 404 resp
onse | 12 // Tests that showing a notification with an image that has a redirect loo
p still succeeds. |
| 13 // works properly, and does not block the actual display of it. | |
| 14 | 13 |
| 15 async_test(function(test) { | 14 async_test(function(test) { |
| 16 var scope = 'resources/scope/' + location.pathname, | 15 var scope = 'resources/scope/' + location.pathname, |
| 17 script = 'instrumentation-service-worker.js'; | 16 script = 'instrumentation-service-worker.js'; |
| 18 | 17 |
| 19 testRunner.setPermission('notifications', 'granted', location.origin,
location.origin); | 18 testRunner.setPermission('notifications', 'granted', location.origin,
location.origin); |
| 20 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(info) { | 19 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi
on(info) { |
| 21 // (1) Display a Web Notification with an image that 404s. | 20 // (1) Display a Web Notification with an image that redirects. |
| 22 return info.registration.showNotification(scope, { | 21 return info.registration.showNotification(scope, { |
| 23 body: 'Hello, world!', | 22 body: 'Hello, world!', |
| 24 icon: '/resources/404image.php' | 23 icon: '/resources/redirectloop.php' |
| 25 }); | 24 }); |
| 26 }).then(function() { | 25 }).then(function() { |
| 27 test.done(); | 26 test.done(); |
| 28 }).catch(unreached_rejection(test)); | 27 }).catch(unreached_rejection(test)); |
| 29 | 28 |
| 30 }, 'Displaying a notification with an image that 404s still resolves the p
romise.'); | 29 }, 'Showing a notification with an image that has a redirect loop still su
cceeds.'); |
| 31 </script> | 30 </script> |
| 32 </body> | 31 </body> |
| 33 </html> | 32 </html> |
| OLD | NEW |