From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- .../shownotification-without-permission.https.window.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'testing/web-platform/tests/notifications/shownotification-without-permission.https.window.js') 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"); -- cgit v1.2.3