WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
175184
WebDriver: implement unhandled prompt behavior
https://bugs.webkit.org/show_bug.cgi?id=175184
Summary
WebDriver: implement unhandled prompt behavior
Carlos Garcia Campos
Reported
2017-08-04 03:56:50 PDT
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-user-prompt-handler
Attachments
Patch
(75.92 KB, patch)
2017-08-07 10:35 PDT
,
Carlos Garcia Campos
bburg
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Carlos Garcia Campos
Comment 1
2017-08-07 10:35:07 PDT
Created
attachment 317435
[details]
Patch
Build Bot
Comment 2
2017-08-07 10:37:23 PDT
Attachment 317435
[details]
did not pass style-queue: ERROR: Source/WebDriver/Session.h:106: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.h:107: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:146: Extra space before ( in function call [whitespace/parens] [4] ERROR: Source/WebDriver/Session.cpp:197: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 4 in 7 files If any of these errors are false positives, please file a bug against check-webkit-style.
Blaze Burg
Comment 3
2017-08-07 10:53:12 PDT
Comment on
attachment 317435
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=317435&action=review
r=me
> Source/WebDriver/ChangeLog:16 > + as part fo the result error message.
Nit: of
> Source/WebDriver/ChangeLog:19 > + (WebDriver::Session::handleUserPrompts): Check if therre's an active JavaScript dialog and deal with it depeding
Nit: there's
> Source/WebDriver/Session.cpp:167 > + bool shouldFailOnDismiss = false;
I think it would be cleaner here to use a std::optional<UnhandledPromptBehavior>. The !value() case can go before the switch and you can move the most complicated part of the switch case (the if branch) out of the switch entirely.
> Source/WebDriver/Session.cpp:210 > + errorResult.setAdditonalErrorData(WTFMove(additonalData));
Nit: setAdditionalErrorData
> Source/WebDriver/Session.cpp:223 > + handleUserPrompts([this, url, completionHandler = WTFMove(completionHandler)](CommandResult&& result) mutable {
This significantly indents most of the session code. Is there a way we can extract it into a separate method to cut down on async indent noise? (this situation always makes me miss JS promises..)
Carlos Garcia Campos
Comment 4
2017-08-07 23:40:24 PDT
(In reply to Brian Burg from
comment #3
)
> Comment on
attachment 317435
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=317435&action=review
> > r=me > > > Source/WebDriver/ChangeLog:16 > > + as part fo the result error message. > > Nit: of > > > Source/WebDriver/ChangeLog:19 > > + (WebDriver::Session::handleUserPrompts): Check if therre's an active JavaScript dialog and deal with it depeding > > Nit: there's > > > Source/WebDriver/Session.cpp:167 > > + bool shouldFailOnDismiss = false; > > I think it would be cleaner here to use a > std::optional<UnhandledPromptBehavior>. The !value() case can go before the > switch and you can move the most complicated part of the switch case (the if > branch) out of the switch entirely. > > > Source/WebDriver/Session.cpp:210 > > + errorResult.setAdditonalErrorData(WTFMove(additonalData)); > > Nit: setAdditionalErrorData
Oops.
> > Source/WebDriver/Session.cpp:223 > > + handleUserPrompts([this, url, completionHandler = WTFMove(completionHandler)](CommandResult&& result) mutable { > > This significantly indents most of the session code. Is there a way we can > extract it into a separate method to cut down on async indent noise? (this > situation always makes me miss JS promises..)
That's the problem of lambdas :-/ things are even worse when we end up nesting several lambdas. Fortunately, I think waiting for navigation and handling prompts are the only global things we have to do before running commands, so this is the last time we have to reindent.
Carlos Garcia Campos
Comment 5
2017-08-07 23:43:35 PDT
Committed
r220388
: <
http://trac.webkit.org/changeset/220388
>
Radar WebKit Bug Importer
Comment 6
2017-08-07 23:44:38 PDT
<
rdar://problem/33770251
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug