commit 725f45a58eaf4ee23ff8c5d3773b2a675441220c
parent 75ac0fc100a323d11461ecdb09ff7c06cadd846e
Author: Julian Descottes <jdescottes@mozilla.com>
Date: Thu, 13 Nov 2025 14:52:00 +0000
Bug 1855045 - [wdspec] Add input file_dialog_opened test for input.showPicker API r=Sasha
Differential Revision: https://phabricator.services.mozilla.com/D271793
Diffstat:
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/testing/web-platform/tests/webdriver/tests/bidi/input/file_dialog_opened/file_dialog_opened.py b/testing/web-platform/tests/webdriver/tests/bidi/input/file_dialog_opened/file_dialog_opened.py
@@ -16,7 +16,7 @@ async def test_unsubscribe(bidi_session, inline, top_context, wait_for_event,
await bidi_session.session.subscribe(events=[FILE_DIALOG_OPENED_EVENT])
await bidi_session.session.unsubscribe(events=[FILE_DIALOG_OPENED_EVENT])
- # Track all received browsingContext.navigationStarted events in the events array
+ # Track all received input.fileDialogOpened events in the events array
events = []
async def on_event(method, data):
@@ -62,6 +62,26 @@ async def test_subscribe(bidi_session, subscribe_events, inline, top_context,
assert_file_dialog_opened_event(event, top_context["context"])
+async def test_show_picker(bidi_session, subscribe_events, inline, top_context,
+ wait_for_event, wait_for_future_safe):
+ await subscribe_events(events=[FILE_DIALOG_OPENED_EVENT])
+ on_entry = wait_for_event(FILE_DIALOG_OPENED_EVENT)
+
+ url = inline("<input id=input type=file />")
+ await bidi_session.browsing_context.navigate(context=top_context["context"],
+ url=url, wait="complete")
+
+ await bidi_session.script.evaluate(
+ expression="input.showPicker()",
+ target=ContextTarget(top_context["context"]),
+ await_promise=False,
+ user_activation=True
+ )
+
+ event = await wait_for_future_safe(on_entry)
+ assert_file_dialog_opened_event(event, top_context["context"])
+
+
@pytest.mark.parametrize("multiple", [True, False])
async def test_multiple(bidi_session, subscribe_events, inline, top_context,
wait_for_event, wait_for_future_safe, multiple):