From 285112bc89fd8f9b42f3d1c8b2fa7680229a94e4 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 1 Jan 2025 01:15:37 +0000 Subject: [PATCH] Bug 1937160 [wpt PR 49681] - Make closeWatcher.requestClose() not require user activation, a=testonly Automatic update from web-platform-tests Make closeWatcher.requestClose() not require user activation Per the conversation here: https://github.com/openui/open-ui/issues/1128#issuecomment-2539519339 There's a desire to ship closeWatcher.requestClose() along with dialog.requestclose() both not requiring user activation. The spec PR has been updated accordingly: https://github.com/whatwg/html/pull/10737 (in this commit: https://github.com/whatwg/html/pull/10737/commits/76619aa99f37cef85be93ff98fadd03284347008) Fixed: 383593252 Change-Id: I8c05e352d8b4964407a1cee36f35372e192e2ca5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6092173 Auto-Submit: Mason Freed Reviewed-by: David Baron Reviewed-by: Mason Freed Commit-Queue: Mason Freed Cr-Commit-Position: refs/heads/main{#1396007} -- wpt-commits: 36042af16ff7ebcbf7ed2b12401a10939d5842a0 wpt-pr: 49681 UltraBlame original commit: c689e198a6664efd81b4283aa8a7f19430c37c07 --- testing/web-platform/tests/close-watcher/basic.html | 6 +++--- .../tests/close-watcher/inside-event-listeners.html | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testing/web-platform/tests/close-watcher/basic.html b/testing/web-platform/tests/close-watcher/basic.html index 79a91e127ef6..1b0926305596 100644 --- a/testing/web-platform/tests/close-watcher/basic.html +++ b/testing/web-platform/tests/close-watcher/basic.html @@ -14,7 +14,7 @@ watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"]); + assert_array_equals(events, ["cancel[cancelable=true]", "close"]); }, "requestClose() with no user activation"); test(t => { @@ -43,10 +43,10 @@ let watcher = createRecordingCloseWatcher(t, events); watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"]); + assert_array_equals(events, ["cancel[cancelable=true]", "close"]); watcher.destroy(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"]); + assert_array_equals(events, ["cancel[cancelable=true]", "close"]); }, "requestClose() then destroy()"); test(t => { diff --git a/testing/web-platform/tests/close-watcher/inside-event-listeners.html b/testing/web-platform/tests/close-watcher/inside-event-listeners.html index 47f431e25036..93996fb5fee3 100644 --- a/testing/web-platform/tests/close-watcher/inside-event-listeners.html +++ b/testing/web-platform/tests/close-watcher/inside-event-listeners.html @@ -30,10 +30,10 @@ watcher.onclose = () => { watcher.destroy(); } watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"]); + assert_array_equals(events, ["cancel[cancelable=true]", "close"]); watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"], "since it was inactive, no more events fired"); + assert_array_equals(events, ["cancel[cancelable=true]", "close"], "since it was inactive, no more events fired"); }, "destroy() inside onclose"); promise_test(async t => { @@ -58,10 +58,10 @@ watcher.onclose = () => { watcher.close(); } watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"]); + assert_array_equals(events, ["cancel[cancelable=true]", "close"]); watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"], "since it was inactive, no more events fired"); + assert_array_equals(events, ["cancel[cancelable=true]", "close"], "since it was inactive, no more events fired"); }, "close() inside onclose"); promise_test(async t => { @@ -86,9 +86,9 @@ watcher.onclose = () => { watcher.requestClose(); } watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"]); + assert_array_equals(events, ["cancel[cancelable=true]", "close"]); watcher.requestClose(); - assert_array_equals(events, ["cancel[cancelable=false]", "close"], "since it was inactive, no more events fired"); + assert_array_equals(events, ["cancel[cancelable=true]", "close"], "since it was inactive, no more events fired"); }, "requestClose() inside onclose");