Skip to content

Commit

Permalink
Bug 1937160 [wpt PR 49681] - Make closeWatcher.requestClose() not req…
Browse files Browse the repository at this point in the history
…uire user activation, a=testonly

Automatic update from web-platform-tests
Make closeWatcher.requestClose() not require user activation

Per the conversation here:

openui/open-ui#1128 (comment)

There's a desire to ship closeWatcher.requestClose() along with
dialog.requestclose() both not requiring user activation.

The spec PR has been updated accordingly:
whatwg/html#10737

(in this commit:
whatwg/html@76619aa)

Fixed: 383593252
Change-Id: I8c05e352d8b4964407a1cee36f35372e192e2ca5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6092173
Auto-Submit: Mason Freed <[email protected]>
Reviewed-by: David Baron <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1396007}

--

wpt-commits: 36042af16ff7ebcbf7ed2b12401a10939d5842a0
wpt-pr: 49681
  • Loading branch information
mfreed7 authored and moz-wptsync-bot committed Dec 18, 2024
1 parent d5508d9 commit e2f16c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions testing/web-platform/tests/close-watcher/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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 => {
Expand All @@ -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");
</script>

0 comments on commit e2f16c4

Please sign in to comment.