[Webkit-unassigned] [Bug 42612] DRT should allow test scripts to access WebCore internal states for setup/verification

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 26 17:15:40 PDT 2010


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





--- Comment #12 from Ojan Vafai <ojan at chromium.org>  2010-07-26 17:15:40 PST ---
(From update of attachment 62547)
Except for the naming nits below, this patch looks good to me, so I'm not setting r-. But I know Darin and Maciej had some reservations about extending layoutTestController at all. So I'd like one of them to at least look at this before setting r+.

> +++ b/LayoutTests/fast/dom/Window/script-tests/window-layout-test-controller-core.js

Please rename to window-layout-test-controller.js or window-layout-test-controller-webcore.js.


In all of the below, please rename core to webCoreLayoutTestController and coreObject to webCoreLayoutTestControllerObject. It's more verbose, but much less confusing.

> +++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
> +static const char setupLayoutTestControllerScript[] = 
> +    "function delegate(dst, src, name) { dst[name] = function() { return src[name].apply(src, arguments); } }\n"
> +    "for (var name in this.core) {\n"
> +    "    delegate(this, this.core, name);\n"
> +    "}\n";
> +
> +void LayoutTestController::makeDelegationMethods(JSContextRef context, JSObjectRef thisObject, JSValueRef coreObject, JSValueRef* exception)
> +{
> +    JSRetainPtr<JSStringRef> coreStr(Adopt, JSStringCreateWithUTF8CString("core"));
> +    JSObjectSetProperty(context, thisObject, coreStr.get(), coreObject, kJSPropertyAttributeNone, exception);
> +    ASSERT(!*exception);

> -void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
> +void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception, JSValueRef core)
> @@ -1706,6 +1725,9 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi
>  
> +    if (core)
> +        makeDelegationMethods(context, JSValueToObject(context, layoutTestContollerObject, exception), core, exception);
> +

> +++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
> -    void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception);
> +    void makeDelegationMethods(JSContextRef context, JSObjectRef thisObject, JSValueRef coreObject, JSValueRef* exception);
> +    void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception, JSValueRef core = 0);

> +++ b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
> +    JSValueRef coreLayoutTestController = [frame layoutTestController];
> +    gLayoutTestController->makeWindowObject(context, globalObject, &exception, coreLayoutTestController);
>      ASSERT(!exception);

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list