blob: 44b6225f8305d85afee316bf632f388a8bfc0bcd [file] [log] [blame]
<html>
<head>
<script src="resources/push-api-test-pre.js"></script>
<script src="resources/subscribe-tests.js"></script>
</head>
<body>
<script>
navigator.serviceWorker.register("resources/subscribe-worker.js", { }).then(async (registration) => {
try {
await waitForState(registration.installing, "activated");
await testServiceWorkerPermissionState(registration, 'prompt');
await testDocumentPermissionState(registration, 'prompt');
await testServiceWorkerSubscribe(registration, 'NotAllowedError');
await testDocumentSubscribeWithoutUserGesture(registration, 'NotAllowedError');
await testDocumentSubscribeWithUserGesture(registration);
} catch (e) {
log(`FAIL: unexpected exception ${e}`);
} finally {
await registration.unregister();
finishPushAPITest();
}
});
</script>
</body>
</html>