blob: 4f9fc1b14afb533005cd68e3c42d084a7e47aa7c [file] [log] [blame]
<!doctype html>
<html>
<head>
<title>Notifications: Showing a notification with an image that has a redirect loop still succeeds.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../serviceworker/resources/test-helpers.js"></script>
<script src="resources/test-helpers.js"></script>
</head>
<body>
<script>
// Tests that showing a notification with an image that has a redirect loop still succeeds.
async_test(function(test) {
var scope = 'resources/scope/' + location.pathname,
script = 'instrumentation-service-worker.js';
testRunner.setPermission('notifications', 'granted', location.origin, location.origin);
getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(info) {
// (1) Display a Web Notification with an image that redirects.
return info.registration.showNotification(scope, {
body: 'Hello, world!',
icon: '/resources/redirectloop.php'
});
}).then(function() {
test.done();
}).catch(unreached_rejection(test));
}, 'Showing a notification with an image that has a redirect loop still succeeds.');
</script>
</body>
</html>