4 <title>Notifications: Showing a notification with an image that
404s.
</title>
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>
12 // Tests that showing a notification with an image that creates a 404 response
13 // works properly, and does not block the actual display of it.
15 async_test(function(test
) {
16 var scope
= 'resources/scope/' + location
.pathname
,
17 script
= 'resources/instrumentation-service-worker.js';
19 testRunner
.setPermission('notifications', 'granted', location
.origin
, location
.origin
);
20 getActiveServiceWorkerWithMessagePort(test
, script
, scope
).then(function(info
) {
21 // (1) Display a Web Notification with an image that 404s.
22 return info
.registration
.showNotification(scope
, {
23 body
: 'Hello, world!',
24 icon
: '/resources/404image.php'
28 }).catch(unreached_rejection(test
));
30 }, 'Displaying a notification with an image that 404s still resolves the promise.');