add_task(async function test_notifications_permission_error() {
await setPushPermission(false);
try {
await registration.pushManager.subscribe();
ok(false, "No permission, should never proceed");
} catch (err) {
is(err.name, "NotAllowedError", "A permission error should occur");
}
});
add_task(async function test_notifications_permission_granted() {
await setPushPermission(true);
try {
await registration.pushManager.subscribe();
ok(false, "For now this should not proceed because of dom.push.connection.enabled=false (default for all tests)");
} catch (err) {
is(err.name, "AbortError", "For now a connection error should occur");
}
});
add_task(async function unregister() {
const result = await registration.unregister();
ok(result, "Unregister should return true.");
});
</script>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.