Bug 174623 - Web Automation: evaluateJavaScriptFunction should always notify the web process before returning early
Summary: Web Automation: evaluateJavaScriptFunction should always notify the web proce...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2017-07-18 05:19 PDT by Carlos Garcia Campos
Modified: 2017-07-18 23:08 PDT (History)
2 users (show)

See Also:

Patch (3.10 KB, patch)
2017-07-18 05:20 PDT, Carlos Garcia Campos
bburg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
Comment 2 BJ Burg 2017-07-18 15:20:57 PDT
Comment on attachment 315790 [details]

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