Bug 174623

Summary: Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, joepeck
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bburg: review+

Description Carlos Garcia Campos 2017-07-18 05:19:28 PDT
It currently returns early if page, frame or scriptObject are nullptr, in which cases the UI process is not notified. This causes test testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs to hang, because message DidEvaluateJavaScriptFunction is never sent when the given frame no longer exists. We should send DidEvaluateJavaScriptFunction with WindowNotFound in case of page is nullptr and FrameNotFound if the frame is nullptr. The scriptObject early return is actually wrong, because scriptObjectForFrame creates a new script if there's isn't one for the given frame.
Comment 1 Carlos Garcia Campos 2017-07-18 05:20:44 PDT
Created attachment 315790 [details]
Patch
Comment 2 BJ Burg 2017-07-18 15:20:57 PDT
Comment on attachment 315790 [details]
Patch

Good catch, r = me
Comment 3 Carlos Garcia Campos 2017-07-18 23:08:38 PDT
Committed r219650: <http://trac.webkit.org/changeset/219650>