blob: 25df1d62da5b871bfaab0abc8d9fce15f8dcb60e [file] [log] [blame]
<script src="push-api-test-pre.js"></script>
<script src="subscribe-tests.js"></script>
<script>
navigator.serviceWorker.register("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>