[Webkit-unassigned] [Bug 155221] Add WebAutomationSessionProxy for WebProcess side automation tasks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 10 02:24:36 PST 2016


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

--- Comment #7 from Timothy Hatcher <timothy at apple.com> ---
Comment on attachment 273551
  --> https://bugs.webkit.org/attachment.cgi?id=273551
WIP Sketch v2

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

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp:258
> +    page->process().send(Messages::WebAutomationSessionProxy::EvaluateJavaScript(page->mainFrame()->frameID(), WTF::emptyString()), 0);

Note: mainFrame can be null. It is null when the WebPageProxy is first created. I am not sure on when it is available yet, be we should null check it.

> Source/WebKit2/UIProcess/Automation/WebAutomationSession.messages.in:25
> +messages -> WebAutomationSession {
> +    Test()
> +}

We will likely need these messages to the UIProcess to implement execute_async or any other events.

> Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.cpp:101
> +    JSRetainPtr<JSStringRef> testString(Adopt, JSStringCreateWithUTF8CString("test"));
> +    JSObjectRef testFunction = (JSObjectRef)JSObjectGetProperty(context, scriptObject, testString.get(), &exception);
> +    RELEASE_ASSERT(!exception);
> +    RELEASE_ASSERT(JSObjectIsFunction(context, testFunction));
> +
> +    JSObjectCallAsFunction(context, testFunction, nullptr, 0, nullptr, &exception);
> +    RELEASE_ASSERT(!exception);

Just a test. This would call JSEvaluateScript and pass the result to the injected script for processing (turning elements into handles, etc.)

> Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js:43
> +    test()
> +    {
> +        console.log("Hello World!");
> +    }

This gets called in the end by requesting the refresh endpoint right now.

> Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1584
> +    if (auto automationSessionProxy = WebProcess::singleton().automationSessionProxy())
> +        automationSessionProxy->didClearWindowObjectForFrame(*m_frame);

Needed so we unprotect our script object ref.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160310/1b60526e/attachment.html>


More information about the webkit-unassigned mailing list