Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Notifications: Showing a notification with an image that 404s.</title > | |
|
Michael van Ouwerkerk
2015/02/19 11:41:46
nit: update title
Peter Beverloo
2015/02/19 12:03:54
Done.
| |
| 5 <script src="../resources/testharness.js"></script> | |
| 6 <script src="../resources/testharnessreport.js"></script> | |
| 7 <script src="../serviceworker/resources/test-helpers.js"></script> | |
| 8 <script src="resources/test-helpers.js"></script> | |
| 9 </head> | |
| 10 <body> | |
| 11 <script> | |
| 12 // Tests that showing a notification with an image that takes a non-trivia l | |
| 13 // time to load still ends up resolving the promise. | |
| 14 | |
| 15 async_test(function(test) { | |
| 16 var scope = 'resources/scope/' + location.pathname, | |
| 17 script = 'resources/instrumentation-service-worker.js'; | |
| 18 | |
| 19 testRunner.grantWebNotificationPermission(location.origin, true); | |
| 20 getActiveServiceWorkerWithMessagePort(test, script, scope).then(functi on(info) { | |
| 21 // (1) Display a Web Notification with an image that takes 200ms t o load. | |
| 22 return info.registration.showNotification(scope, { | |
| 23 body: 'Hello, world!', | |
| 24 icon: '/resources/slow-image.php?redirect_name=square100.png&m imeType=image/png&sleep=200' | |
| 25 }); | |
| 26 }).then(function() { | |
| 27 test.done(); | |
| 28 }).catch(unreached_rejection(test)); | |
| 29 | |
| 30 }, 'Displaying a notification with an image that takes some time to load s till resolves the promise.'); | |
| 31 </script> | |
| 32 </body> | |
| 33 </html> | |
| OLD | NEW |