commit 798e02e901e02bb6f70957517ebb30b1eeeff79b
parent 53153ed1f3d3eded55bd396813371a0bf6799093
Author: Mason Freed <masonf@chromium.org>
Date: Wed, 12 Nov 2025 08:51:15 +0000
Bug 1999196 [wpt PR 55957] - Fix menuitem-activate failures [5/4], a=testonly
Automatic update from web-platform-tests
Fix menuitem-activate failures [5/4]
This fixes two bugs:
- headless shell doesn't like re-using test_driver.Actions()
objects, and will fail if you try.
- The popover containing a menu was previously just the size
of the button, so the menu (when activated) didn't fit within
the popover. There were scrollbars, and test_driver.click()
would miss.
Bug: 406566432
Fixed: 453209085
Change-Id: I003a19d9c73929d8ff8def9ff9f0e993dbdaedfb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7087711
Reviewed-by: Dominic Farolino <dom@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1543016}
--
wpt-commits: 54203ac0cf9270bd30f55d3dd0326113437d4277
wpt-pr: 55957
Diffstat:
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/testing/web-platform/tests/html/semantics/menu/tentative/menuitem-activate.html b/testing/web-platform/tests/html/semantics/menu/tentative/menuitem-activate.html
@@ -37,6 +37,13 @@
</menulist>
</div>
+<style>
+ [popover] {
+ width: 400px;
+ height: 400px;
+ }
+</style>
+
<script>
promise_test(async () => {
assert_false(mainmenu.matches(":popover-open"), "mainmenu popover starts closed");
@@ -118,15 +125,17 @@ promise_test(async (t) => {
assert_false(mainmenu.matches(":popover-open"), "mainmenu popover starts closed");
let clickCount = 0;
normalmenuitem.addEventListener('click',() => (++clickCount));
- const actions = new test_driver.Actions();
- await actions.addPointer('mouse', 'mouse')
+ await new test_driver.Actions()
+ .addPointer('mouse', 'mouse')
.pointerMove(0, 0, {origin: menubarmenuitem})
.pointerDown()
.send();
await waitForRender();
assert_true(mainmenu.matches(":popover-open"), "mainmenu popover should be open while mouse is down");
assert_equals(clickCount,0, "no clicks yet");
- await actions.pointerMove(0, 0, {origin: normalmenuitem})
+ await new test_driver.Actions()
+ .addPointer('mouse', 'mouse')
+ .pointerMove(0, 0, {origin: normalmenuitem})
.pointerUp()
.send();
await waitForRender();
@@ -139,15 +148,17 @@ promise_test(async (t) => {
promise_test(async (t) => {
assert_false(mainmenu.matches(":popover-open"), "mainmenu popover starts closed");
assert_false(submenu.matches(":popover-open"), "submenu popover starts closed");
- const actions = new test_driver.Actions();
- await actions.addPointer('mouse', 'mouse')
+ await new test_driver.Actions()
+ .addPointer('mouse', 'mouse')
.pointerMove(0, 0, {origin: menubarmenuitem})
.pointerDown()
.send();
await waitForRender();
assert_true(mainmenu.matches(":popover-open"), "mainmenu popover should be open while mouse is down");
assert_false(submenu.matches(":popover-open"), "submenu shouldn't be open yet");
- await actions.pointerMove(0, 0, {origin: mainmenuitem})
+ await new test_driver.Actions()
+ .addPointer('mouse', 'mouse')
+ .pointerMove(0, 0, {origin: mainmenuitem})
.pointerUp()
.send();
await waitForRender();