Bug 154991

Summary: Inform WebKit and WebCore if a page is controlled by automation
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: WebKit2Assignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, bburg, commit-queue, graouts, joepeck, mattbaker, mitz, nvasilyev, thorton, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Timothy Hatcher 2016-03-03 16:22:50 PST
WebCore will need to know if a page is automated to expose extra WebDriver API on the navigator object. WebKit2 also needs to know for Safari's injected bundle code.
Comment 1 Radar WebKit Bug Importer 2016-03-03 16:23:22 PST
<rdar://problem/24965784>
Comment 2 Timothy Hatcher 2016-03-03 16:27:41 PST
Created attachment 272793 [details]
Patch
Comment 3 Joseph Pecoraro 2016-03-04 00:05:20 PST
Comment on attachment 272793 [details]
Patch

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

r=me

> Source/WebKit2/UIProcess/API/C/WKPagePrivate.h:88
> +WK_EXPORT bool WKPageGetIsControlledByAutomation(WKPageRef page);
> +WK_EXPORT void WKPageSetControlledByAutomation(WKPageRef page, bool controlled);

It seems a little roundabout to require a WK2 API for a client to decide the page is for automation. I realize that is the case right now, but perhaps we should file a bug / have a comment somewhere that we should move to having automation pages in their own process pool, so it is guaranteed / known in WebKit what pages are automation without requiring client involvement.
Comment 4 WebKit Commit Bot 2016-03-04 08:55:47 PST
Comment on attachment 272793 [details]
Patch

Clearing flags on attachment: 272793

Committed r197564: <http://trac.webkit.org/changeset/197564>
Comment 5 WebKit Commit Bot 2016-03-04 08:55:50 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 BJ Burg 2016-03-05 16:02:49 PST
Comment on attachment 272793 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/C/WKPagePrivate.h:88
>> +WK_EXPORT void WKPageSetControlledByAutomation(WKPageRef page, bool controlled);
> 
> It seems a little roundabout to require a WK2 API for a client to decide the page is for automation. I realize that is the case right now, but perhaps we should file a bug / have a comment somewhere that we should move to having automation pages in their own process pool, so it is guaranteed / known in WebKit what pages are automation without requiring client involvement.

While in general I agree that it would be nice to confine automation pages to their own process pool, this may not be feasible for all ports. I'l file a bug internally to get feedback. <rdar://problem/24996361>