summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js')
-rw-r--r--testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js b/testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js
index 37b3dbbef6..b09c0460fb 100644
--- a/testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js
+++ b/testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js
@@ -8,20 +8,14 @@
let registration;
promise_setup(async () => {
+ await trySettingPermission("prompt");
registration = await getActiveServiceWorker("noop-sw.js");
+ await closeAllNotifications();
});
-promise_test(async (t) => {
+promise_test(async t => {
t.add_cleanup(closeAllNotifications);
- try {
- await test_driver.set_permission({ name: "notifications" }, "prompt");
- } catch {
- // Not all implementations support this yet, but it may already be "prompt" to be able to continue
- }
-
- assert_equals(Notification.permission, "default", "Should have the default permission to continue");
-
await promise_rejects_js(t, TypeError, registration.showNotification(""), "Should throw TypeError");
const notifications = await registration.getNotifications();
assert_equals(notifications.length, 0, "Should return zero notification");