Bug 183306 - Notify the NetworkProcess when a session is servicing an automation client
Summary: Notify the NetworkProcess when a session is servicing an automation client
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 183378
  Show dependency treegraph
 
Reported: 2018-03-02 16:22 PST by Brent Fulgham
Modified: 2018-03-06 12:09 PST (History)
7 users (show)

See Also:


Attachments
Patch (5.63 KB, patch)
2018-03-02 16:35 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (5.63 KB, patch)
2018-03-02 17:28 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (5.97 KB, patch)
2018-03-03 09:59 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff
Patch (6.42 KB, patch)
2018-03-03 10:09 PST, Brent Fulgham
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2018-03-02 16:22:48 PST
Network loads servicing WebDriver are done through an ephemeral session. While this is great for protecting a developer's machine from sharing state with test runs, it has the unintended effect of blocking certain logging operations.

We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions generated by WebDriver should participate in logging so that proper testing (with logging) can be done.

This patch signals the NetworkProcess when an ephemeral session (created for automation purposes) is created, so that it can allow logging.
Comment 1 Brent Fulgham 2018-03-02 16:35:29 PST
Created attachment 334940 [details]
Patch
Comment 2 Brent Fulgham 2018-03-02 17:28:37 PST
Created attachment 334943 [details]
Patch
Comment 3 BJ Burg 2018-03-02 20:32:49 PST
Comment on attachment 334940 [details]
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:427
> +    if (m_controlledByAutomation)

This won't work because the member isn't set in the constructor. You should put this message send in the setter.
Comment 4 BJ Burg 2018-03-02 20:33:36 PST
Comment on attachment 334943 [details]
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:427
> +    if (m_controlledByAutomation)

Ditto to previous comment.
Comment 5 Brent Fulgham 2018-03-03 09:22:51 PST
Comment on attachment 334943 [details]
Patch

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

>> Source/WebKit/UIProcess/WebPageProxy.cpp:427
>> +    if (m_controlledByAutomation)
> 
> Ditto to previous comment.

Doesn't it get assigned on Line 373 above?
Comment 6 Brent Fulgham 2018-03-03 09:59:30 PST
Created attachment 334961 [details]
Patch
Comment 7 Brent Fulgham 2018-03-03 10:00:52 PST
(In reply to Brent Fulgham from comment #5)
> Comment on attachment 334943 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=334943&action=review
> 
> >> Source/WebKit/UIProcess/WebPageProxy.cpp:427
> >> +    if (m_controlledByAutomation)
> > 
> > Ditto to previous comment.
> 
> Doesn't it get assigned on Line 373 above?

I guess you meant that it's only ever set by the API; we never set automation through the page configuration directly.
Comment 8 Brent Fulgham 2018-03-03 10:09:18 PST
Created attachment 334962 [details]
Patch
Comment 9 BJ Burg 2018-03-03 13:31:47 PST
Comment on attachment 334962 [details]
Patch

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

r=me

> Source/WebKit/UIProcess/WebPageProxy.cpp:1288
> +    m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::SetSessionIsControlledByAutomation(m_websiteDataStore->sessionID(), m_controlledByAutomation));

This looks good!
Comment 10 WebKit Commit Bot 2018-03-03 15:27:22 PST
Comment on attachment 334962 [details]
Patch

Clearing flags on attachment: 334962

Committed r229201: <https://trac.webkit.org/changeset/229201>
Comment 11 WebKit Commit Bot 2018-03-03 15:27:24 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2018-03-03 15:28:19 PST
<rdar://problem/38107474>
Comment 13 Brent Fulgham 2018-03-03 15:52:48 PST
This is actually:

<rdar://problem/37835783>