You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8156ba6
Browse filesBrowse the repository at this point in the historyBrowse files
[WebDriver] Support the map form of the unhandledPromptBehavior capability
https://bugs.webkit.org/show_bug.cgi?id=289307
Reviewed by Alexey Proskuryakov.
WebDriver only accepted unhandledPromptBehavior as a string, so a session
requesting a per-prompt-type map such as {"default": "ignore"} failed to
start. Most WebDriver BiDi user prompt tests use the map form.
Parse the capability as a string or a map of prompt types (alert,
beforeUnload, confirm, default, file, prompt) to handlers, store it as a
user prompt handler, and serialize it back in the new session response as
the spec describes. When handling a user prompt in a classic command, ask
the browser for the dialog type through a new Automation command,
typeOfCurrentJavaScriptDialog, and pick the handler with the spec's
"get the prompt handler" steps. If typeOfCurrentJavaScriptDialog reports
that no dialog is showing, the dialog closed after isShowingJavaScriptDialog
returned true, so there is nothing to handle.
The beforeUnload entry is parsed, validated and returned, but changes no
behavior yet: under automation, WebPageProxy::runBeforeUnloadConfirmPanel()
always lets the unload proceed, so no beforeunload prompt reaches the
classic prompt handling, before or after this change. It will matter once
WebDriver BiDi sessions get beforeunload prompts.
Test expectations, from a GTK Release build with asserts:
- classic/new_session/unhandled_prompt_behavior.py passes on GTK. On Mac,
the five test_beforeunload_prompts_always_automatically_accepted subtests
still fail, because the test's own session lacks acceptInsecureCerts and
can't load its https:// page, so they are kept as failing there.
- bidi file/ignore.py now passes fully, so drop its entry.
- bidi file/accept.py and file/dismiss.py map-form subtests now get past
session creation and wait for a file picker WebKit never opens, the same
as the string form. Expect TIMEOUT under bug 291665 (file handler).
- handle_user_prompt.py test_two_top_level_contexts and
user_prompt_closed.py test_unsubscribe now pass.
- user_prompt_closed.py test_subscribe_to_one_context times out, matching
the same subtests in user_prompt_opened.py (bug 282981).
* Source/WebDriver/Capabilities.h:
* Source/WebDriver/Session.cpp:
(WebDriver::promptHandlerForType):
(WebDriver::userPromptTypeFromDialogType):
(WebDriver::Session::handleUnexpectedAlertOpen):
* Source/WebDriver/WebDriverService.cpp:
(WebDriver::deserializePromptHandlerConfiguration):
(WebDriver::deserializeUnhandledPromptBehavior):
(WebDriver::serializePromptHandlerConfiguration):
(WebDriver::serializeUserPromptHandler):
(WebDriver::WebDriverService::parseCapabilities const):
(WebDriver::WebDriverService::validatedCapabilities const):
(WebDriver::WebDriverService::createSession):
* Source/WebKit/UIProcess/Automation/Automation.json:
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::typeOfCurrentJavaScriptDialog):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.h:
* WebDriverTests/TestExpectations.json:
Canonical link: https://commits.webkit.org/326097@main
{ "name": "result", "type": "boolean", "description": "If the browsing context is showing a JavaScript dialog or not." }
758
764
]
759
765
},
766
+
{
767
+
"name": "typeOfCurrentJavaScriptDialog",
768
+
"description": "Returns the type of the JavaScript dialog currently showing in a browsing context.",
769
+
"parameters": [
770
+
{ "name": "browsingContextHandle", "$ref": "BrowsingContextHandle", "description": "The handle for the browsing context." }
771
+
],
772
+
"returns": [
773
+
{ "name": "type", "$ref": "JavaScriptDialogType", "description": "The type of the current JavaScript dialog." }
774
+
]
775
+
},
760
776
{
761
777
"name": "dismissCurrentJavaScriptDialog",
762
778
"description": "Dismisses a JavaScript alert, confirm, or prompt dialog currently showing in a browsing context. Equivalent to clicking the 'Cancel' button.",
0 commit comments