blob: 076c619881601a5d0decaeae128de5759f9704e1 [file] [log] [blame]
<!doctype html>
<html>
<head>
<title>Notifications: ServiceWorkerRegistration.getNotifications() with no notifications.</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 the getNotifications() function when used in a document without
// notifications returns a promise that gets resolved with an empty array.
async_test(function(test) {
var scope = 'resources/scope/' + location.pathname,
script = 'instrumentation-service-worker.js';
getActiveServiceWorkerWithMessagePort(test, script, scope).then(function(workerInfo) {
return workerInfo.registration.getNotifications();
}).then(function(notifications) {
assert_array_equals(notifications, []);
test.done();
}).catch(unreached_rejection(test));
}, 'ServiceWorkerRegistration.getNotifications() with no notifications.');
</script>
</body>
</html>