Bug 157509

Summary: Web Automation: add command to asynchronously load the Web Inspector frontend in the background
Product: WebKit Reporter: BJ Burg <bburg>
Component: Web InspectorAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed Fix timothy: review+

Description BJ Burg 2016-05-09 23:52:19 PDT
In case you want to use `debugger;` or hit a breakpoint whilst running other actions.
Comment 1 Radar WebKit Bug Importer 2016-05-09 23:52:44 PDT
<rdar://problem/26190121>
Comment 2 BJ Burg 2016-05-10 00:06:50 PDT
Created attachment 278481 [details]
Proposed Fix
Comment 3 Timothy Hatcher 2016-05-10 10:00:32 PDT
Comment on attachment 278481 [details]
Proposed Fix

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

> Source/WebKit2/ChangeLog:36
> +        * WebProcess/Automation/WebAutomationSessionProxy.js:
> +        (let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction):
> +        Rename clearTimeout to window.clearTimeout to be less ambiguous.

I'm not sure why this is needed. We hardly ever prefix the timeout functions.

> Source/WebKit2/UIProcess/Automation/Automation.json:303
> +            },

Stray?
Comment 4 Joseph Pecoraro 2016-05-10 12:26:48 PDT
Comment on attachment 278481 [details]
Proposed Fix

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

> Source/WebKit2/UIProcess/Automation/Automation.json:298
> +            "description": "Inspect the specified browsing context using the Web Inspector.",

We normally drop 'this' in the phrase "the Web Inspector". You wouldn't say "the Xcode" or "the Safari".

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:448
> +    page->inspector()->connect();

Most code that uses page->inspector() includes a nullptr check. We should do that here as well. If the WebPage is closed / invalid then inspector() would be nullptr. Unless there is some other way that this would be avoided.
Comment 5 Joseph Pecoraro 2016-05-10 12:27:17 PDT
> We normally drop 'this'

Err, 'the'
Comment 6 BJ Burg 2016-05-11 13:56:29 PDT
Committed r200702: <http://trac.webkit.org/changeset/200702>