Bug 179979 - WebDriver: handle user prompts shown while executing scripts
Summary: WebDriver: handle user prompts shown while executing scripts
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Blocks: 179999
  Show dependency treegraph
Reported: 2017-11-23 08:20 PST by Carlos Garcia Campos
Modified: 2017-12-02 07:14 PST (History)
3 users (show)

See Also:

Patch (10.65 KB, patch)
2017-11-23 08:26 PST, Carlos Garcia Campos
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-11-23 08:20:20 PST
15.2 Executing Script

The rules to execute a function body are as follows. The algorithm will return success with the JSON representation of the function’s return value, or an error if the evaluation of the function results in a JavaScript exception being thrown or at any point during its execution an unhandled user prompt appears.

If at any point during the algorithm a user prompt appears, the user prompt handler must be invoked. If its return value is an error, it must immediately return with that error and abort all subsequent substeps of this algorithm.

Comment 1 Carlos Garcia Campos 2017-11-23 08:26:18 PST
Created attachment 327505 [details]

I wrote tests for this, I'll upgrade wpt tests as soon as the patch lands. See https://github.com/w3c/web-platform-tests/pull/8413
Comment 2 EWS Watchlist 2017-11-23 08:27:56 PST
Attachment 327505 [details] did not pass style-queue:

ERROR: Source/WebDriver/Session.h:130:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebDriver/Session.cpp:194:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 7 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Carlos Garcia Campos 2017-12-01 05:27:55 PST
Ping Brian.
Comment 4 BJ Burg 2017-12-01 09:59:15 PST
Comment on attachment 327505 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=327505&action=review


> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:569
> +            for (auto id : m_evaluateJavaScriptFunctionCallbacks.keys()) {

Nit: s/id/key/g
Comment 5 Carlos Garcia Campos 2017-12-02 07:13:39 PST
Committed r225448: <https://trac.webkit.org/changeset/225448>
Comment 6 Radar WebKit Bug Importer 2017-12-02 07:14:21 PST