[Webkit-unassigned] [Bug 174421] Web Automation: evaluateJavaScriptFunction should start the callback timeout after the function is applied

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 12 23:22:17 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=174421

--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to Brian Burg from comment #2)
> Comment on attachment 315235 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=315235&action=review
> 
> r=me
> 
> For some reason, this test passes in safaridriver without the patch. I agree
> that this is a valid fix though.

Could it be that in mac Timers implementation two timers scheduled in the same run loop cycle with the same time interval (0) could be dispatched in any order?

> > Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js:54
> > +        let reportResult = (result) => { clearTimeout(timeoutIdentifier); resultCallback(frameID, callbackID, this._jsonStringify(result), false); resultReported = true; };
> 
> This is getting unwieldy, can you add newlines to the function?

Sure.

> The clearTimeout won't do anything if the function being evaluated calls the
> callback/completion handler synchronously. I guess that's okay.

I'm assuming clearTimeout(0) does nothing, but maybe it's better to simply check it before calling it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170713/98e21458/attachment.html>


More information about the webkit-unassigned mailing list