RESOLVED FIXED 174622
Web Automation: pending evaluate script callbacks are stored with the wrong frame ID when using the default main frame
https://bugs.webkit.org/show_bug.cgi?id=174622
Summary Web Automation: pending evaluate script callbacks are stored with the wrong f...
Carlos Garcia Campos
Reported 2017-07-18 04:01:08 PDT
The frameHandle argument is optional in evaluateJavaScriptFunction(), when not provided we pass 0 to the web process. Then, the proxy gets the web page main frame when received frame ID is 0, but the given frameID is still used as key of m_webFramePendingEvaluateJavaScriptCallbacksMap and also passed to the javascript function as argument. I think r203442 was actually a workaround to this bug, making it even more hidden. m_webFrameScriptObjectMap and m_webFramePendingEvaluateJavaScriptCallbacksMap should never have a 0 as key, since the always use a frame ID and the frame identifier counter starts at 1. This is causing test testShouldDetectPageLoadsWhileWaitingOnAnAsyncScriptAndReturnAnError to hang, because when the page is unloaded and didClearWindowObjectForFrame is called, we try to get the pending callbacks of frame 1, but they were stored as frame 0 so DidEvaluateJavaScriptFunction message is never sent to the Ui process.
Attachments
Patch (3.43 KB, patch)
2017-07-18 04:05 PDT, Carlos Garcia Campos
bburg: review+
Carlos Garcia Campos
Comment 1 2017-07-18 04:05:46 PDT
Radar WebKit Bug Importer
Comment 2 2017-07-18 15:32:40 PDT
Blaze Burg
Comment 3 2017-07-18 15:36:38 PDT
Comment on attachment 315789 [details] Patch r=me Great catch!
Carlos Garcia Campos
Comment 4 2017-07-18 23:07:10 PDT
Note You need to log in before you can comment on or make changes to this bug.