<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[145708] trunk/Tools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/145708">145708</a></dd>
<dt>Author</dt> <dd>hausmann@webkit.org</dd>
<dt>Date</dt> <dd>2013-03-13 05:48:47 -0700 (Wed, 13 Mar 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Qt] Prepare DRT for transition to shared TestRunner interface
https://bugs.webkit.org/show_bug.cgi?id=112144

Reviewed by Benjamin Poulain.

Prepare Qt's DRT for a transition from the QObject based TestRunner to
the JSC C API based one.

This is impplemented by instantiating the QObject based testRunner in
the global object, then instantiating the JSC C based TestRunner
separately and placing it &quot;behind&quot; the QObject based testRunner through
injection of the individual functions through proxies. (prototype
chaining doesn't work due to the this object and Function.prototype.bind
doesn't work due to the native function)

This allows for porting over method by method by removing the method
from the QObject TestRunnerQt and implementing it in the JSC C based
TestRunner.

In order for this to link and run dummy implementations of all the
necessary TestRunner functions are provided.

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
(WebCore::DumpRenderTree::initJSObjects):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(DumpRenderTree):
* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunner::~TestRunner):
(TestRunner::addDisallowedURL):
(TestRunner::queueLoad):
(TestRunner::removeAllVisitedLinks):
(TestRunner::setAcceptsEditing):
(TestRunner::simulateLegacyWebNotificationClick):
(TestRunner::setWindowIsKey):
(TestRunner::setAlwaysAcceptCookies):
(TestRunner::addOriginAccessWhitelistEntry):
(TestRunner::setWebViewEditable):
(TestRunner::clearAllApplicationCaches):
(TestRunner::setTextDirection):
(TestRunner::notifyDone):
(TestRunner::numberOfPendingGeolocationPermissionRequests):
(TestRunner::overridePreference):
(TestRunner::pathToLocalResource):
(TestRunner::removeAllWebNotificationPermissions):
(TestRunner::simulateWebNotificationClick):
(TestRunner::closeIdleLocalStorageDatabases):
(TestRunner::focusWebView):
(TestRunner::setBackingScaleFactor):
(TestRunner::removeChromeInputField):
(TestRunner::addChromeInputField):
(TestRunner::originsWithLocalStorage):
(TestRunner::deleteAllLocalStorage):
(TestRunner::deleteLocalStorageForOrigin):
(TestRunner::observeStorageTrackerNotifications):
(TestRunner::syncLocalStorage):
(TestRunner::windowCount):
(TestRunner::setWaitToDump):
(TestRunner::waitForPolicyDelegate):
(TestRunner::webHistoryItemCount):
(TestRunner::showWebInspector):
(TestRunner::closeWebInspector):
(TestRunner::evaluateInWebInspector):
(TestRunner::setSerializeHTTPLoads):
(TestRunner::apiTestNewWindowDataLoadBaseURL):
(TestRunner::setCustomPolicyDelegate):
(TestRunner::setDatabaseQuota):
(TestRunner::setDomainRelaxationForbiddenForURLScheme):
(TestRunner::resetPageVisibility):
(TestRunner::keepWebHistory):
(TestRunner::goBack):
(TestRunner::originsWithApplicationCache):
(TestRunner::applicationCacheDiskUsageForOrigin):
(TestRunner::display):
(TestRunner::dispatchPendingLoadRequests):
(TestRunner::clearPersistentUserStyleSheet):
(TestRunner::callShouldCloseOnWebView):
(TestRunner::copyDecodedHostName):
(TestRunner::clearBackForwardList):
(TestRunner::clearAllDatabases):
(TestRunner::clearApplicationCacheForOrigin):
(TestRunner::apiTestGoToCurrentBackForwardItem):
(TestRunner::authenticateSession):
(TestRunner::abortModal):
(TestRunner::setStorageDatabaseIdleInterval):
(TestRunner::setAsynchronousSpellCheckingEnabled):
(TestRunner::setXSSAuditorEnabled):
(TestRunner::setSpatialNavigationEnabled):
(TestRunner::setScrollbarPolicy):
(TestRunner::setJavaScriptCanAccessClipboard):
(TestRunner::setAutomaticLinkDetectionEnabled):
(TestRunner::setUserStyleSheetEnabled):
(TestRunner::setUserStyleSheetLocation):
(TestRunner::setUseDashboardCompatibilityMode):
(TestRunner::setTabKeyCyclesThroughElements):
(TestRunner::setSmartInsertDeleteEnabled):
(TestRunner::setSelectTrailingWhitespaceEnabled):
(TestRunner::setPrivateBrowsingEnabled):
(TestRunner::setPluginsEnabled):
(TestRunner::setPopupBlockingEnabled):
(TestRunner::setMockSpeechInputDumpRect):
(TestRunner::setPersistentUserStyleSheetLocation):
(TestRunner::setMockGeolocationPosition):
(TestRunner::setMockGeolocationPositionUnavailableError):
(TestRunner::setMockDeviceOrientation):
(TestRunner::setMainFrameIsFirstResponder):
(TestRunner::setIconDatabaseEnabled):
(TestRunner::setGeolocationPermission):
(TestRunner::setDefersLoading):
(TestRunner::setCacheModel):
(TestRunner::setAuthorAndUserStylesEnabled):
(TestRunner::setAllowFileAccessFromFileURLs):
(TestRunner::setAppCacheMaximumSize):
(TestRunner::setAllowUniversalAccessFromFileURLs):
(TestRunner::setApplicationCacheOriginQuota):
(TestRunner::denyWebNotificationPermission):
(TestRunner::grantWebNotificationPermission):
(TestRunner::setValueForUser):
(TestRunner::setViewModeMediaFeature):
(TestRunner::setPageVisibility):
(TestRunner::addMockSpeechInputResult):
(TestRunner::removeOriginAccessWhitelistEntry):
(TestRunner::addUserScript):
(TestRunner::isCommandEnabled):
(TestRunner::evaluateScriptInIsolatedWorld):
(TestRunner::evaluateScriptInIsolatedWorldAndReturnValue):
(TestRunner::copyEncodedHostName):
(TestRunner::addUserStyleSheet):
(TestRunner::findString):
(TestRunner::execCommand):
(TestRunner::localStorageDiskUsageForOrigin):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreeqtDumpRenderTreepro">trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro</a></li>
<li><a href="#trunkToolsDumpRenderTreeqtDumpRenderTreeMaincpp">trunk/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeqtDumpRenderTreeQtcpp">trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp</a></li>
<li><a href="#trunkToolsDumpRenderTreeqtDumpRenderTreeQth">trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h</a></li>
<li><a href="#trunkToolsDumpRenderTreeqtTestRunnerQtcpp">trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (145707 => 145708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2013-03-13 12:48:28 UTC (rev 145707)
+++ trunk/Tools/ChangeLog        2013-03-13 12:48:47 UTC (rev 145708)
</span><span class="lines">@@ -1,3 +1,139 @@
</span><ins>+2013-03-12  Simon Hausmann  &lt;simon.hausmann@digia.com&gt;
+
+        [Qt] Prepare DRT for transition to shared TestRunner interface
+        https://bugs.webkit.org/show_bug.cgi?id=112144
+
+        Reviewed by Benjamin Poulain.
+
+        Prepare Qt's DRT for a transition from the QObject based TestRunner to
+        the JSC C API based one.
+
+        This is impplemented by instantiating the QObject based testRunner in
+        the global object, then instantiating the JSC C based TestRunner
+        separately and placing it &quot;behind&quot; the QObject based testRunner through
+        injection of the individual functions through proxies. (prototype
+        chaining doesn't work due to the this object and Function.prototype.bind
+        doesn't work due to the native function)
+
+        This allows for porting over method by method by removing the method
+        from the QObject TestRunnerQt and implementing it in the JSC C based
+        TestRunner.
+
+        In order for this to link and run dummy implementations of all the
+        necessary TestRunner functions are provided.
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * DumpRenderTree/qt/DumpRenderTreeMain.cpp:
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+        (WebCore::DumpRenderTree::initJSObjects):
+        * DumpRenderTree/qt/DumpRenderTreeQt.h:
+        (DumpRenderTree):
+        * DumpRenderTree/qt/TestRunnerQt.cpp:
+        (TestRunner::~TestRunner):
+        (TestRunner::addDisallowedURL):
+        (TestRunner::queueLoad):
+        (TestRunner::removeAllVisitedLinks):
+        (TestRunner::setAcceptsEditing):
+        (TestRunner::simulateLegacyWebNotificationClick):
+        (TestRunner::setWindowIsKey):
+        (TestRunner::setAlwaysAcceptCookies):
+        (TestRunner::addOriginAccessWhitelistEntry):
+        (TestRunner::setWebViewEditable):
+        (TestRunner::clearAllApplicationCaches):
+        (TestRunner::setTextDirection):
+        (TestRunner::notifyDone):
+        (TestRunner::numberOfPendingGeolocationPermissionRequests):
+        (TestRunner::overridePreference):
+        (TestRunner::pathToLocalResource):
+        (TestRunner::removeAllWebNotificationPermissions):
+        (TestRunner::simulateWebNotificationClick):
+        (TestRunner::closeIdleLocalStorageDatabases):
+        (TestRunner::focusWebView):
+        (TestRunner::setBackingScaleFactor):
+        (TestRunner::removeChromeInputField):
+        (TestRunner::addChromeInputField):
+        (TestRunner::originsWithLocalStorage):
+        (TestRunner::deleteAllLocalStorage):
+        (TestRunner::deleteLocalStorageForOrigin):
+        (TestRunner::observeStorageTrackerNotifications):
+        (TestRunner::syncLocalStorage):
+        (TestRunner::windowCount):
+        (TestRunner::setWaitToDump):
+        (TestRunner::waitForPolicyDelegate):
+        (TestRunner::webHistoryItemCount):
+        (TestRunner::showWebInspector):
+        (TestRunner::closeWebInspector):
+        (TestRunner::evaluateInWebInspector):
+        (TestRunner::setSerializeHTTPLoads):
+        (TestRunner::apiTestNewWindowDataLoadBaseURL):
+        (TestRunner::setCustomPolicyDelegate):
+        (TestRunner::setDatabaseQuota):
+        (TestRunner::setDomainRelaxationForbiddenForURLScheme):
+        (TestRunner::resetPageVisibility):
+        (TestRunner::keepWebHistory):
+        (TestRunner::goBack):
+        (TestRunner::originsWithApplicationCache):
+        (TestRunner::applicationCacheDiskUsageForOrigin):
+        (TestRunner::display):
+        (TestRunner::dispatchPendingLoadRequests):
+        (TestRunner::clearPersistentUserStyleSheet):
+        (TestRunner::callShouldCloseOnWebView):
+        (TestRunner::copyDecodedHostName):
+        (TestRunner::clearBackForwardList):
+        (TestRunner::clearAllDatabases):
+        (TestRunner::clearApplicationCacheForOrigin):
+        (TestRunner::apiTestGoToCurrentBackForwardItem):
+        (TestRunner::authenticateSession):
+        (TestRunner::abortModal):
+        (TestRunner::setStorageDatabaseIdleInterval):
+        (TestRunner::setAsynchronousSpellCheckingEnabled):
+        (TestRunner::setXSSAuditorEnabled):
+        (TestRunner::setSpatialNavigationEnabled):
+        (TestRunner::setScrollbarPolicy):
+        (TestRunner::setJavaScriptCanAccessClipboard):
+        (TestRunner::setAutomaticLinkDetectionEnabled):
+        (TestRunner::setUserStyleSheetEnabled):
+        (TestRunner::setUserStyleSheetLocation):
+        (TestRunner::setUseDashboardCompatibilityMode):
+        (TestRunner::setTabKeyCyclesThroughElements):
+        (TestRunner::setSmartInsertDeleteEnabled):
+        (TestRunner::setSelectTrailingWhitespaceEnabled):
+        (TestRunner::setPrivateBrowsingEnabled):
+        (TestRunner::setPluginsEnabled):
+        (TestRunner::setPopupBlockingEnabled):
+        (TestRunner::setMockSpeechInputDumpRect):
+        (TestRunner::setPersistentUserStyleSheetLocation):
+        (TestRunner::setMockGeolocationPosition):
+        (TestRunner::setMockGeolocationPositionUnavailableError):
+        (TestRunner::setMockDeviceOrientation):
+        (TestRunner::setMainFrameIsFirstResponder):
+        (TestRunner::setIconDatabaseEnabled):
+        (TestRunner::setGeolocationPermission):
+        (TestRunner::setDefersLoading):
+        (TestRunner::setCacheModel):
+        (TestRunner::setAuthorAndUserStylesEnabled):
+        (TestRunner::setAllowFileAccessFromFileURLs):
+        (TestRunner::setAppCacheMaximumSize):
+        (TestRunner::setAllowUniversalAccessFromFileURLs):
+        (TestRunner::setApplicationCacheOriginQuota):
+        (TestRunner::denyWebNotificationPermission):
+        (TestRunner::grantWebNotificationPermission):
+        (TestRunner::setValueForUser):
+        (TestRunner::setViewModeMediaFeature):
+        (TestRunner::setPageVisibility):
+        (TestRunner::addMockSpeechInputResult):
+        (TestRunner::removeOriginAccessWhitelistEntry):
+        (TestRunner::addUserScript):
+        (TestRunner::isCommandEnabled):
+        (TestRunner::evaluateScriptInIsolatedWorld):
+        (TestRunner::evaluateScriptInIsolatedWorldAndReturnValue):
+        (TestRunner::copyEncodedHostName):
+        (TestRunner::addUserStyleSheet):
+        (TestRunner::findString):
+        (TestRunner::execCommand):
+        (TestRunner::localStorageDiskUsageForOrigin):
+
</ins><span class="cx"> 2013-03-12  Julie Parent  &lt;jparent@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Cleanup: Move flatten-trie to loader.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeqtDumpRenderTreepro"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro (145707 => 145708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro        2013-03-13 12:48:28 UTC (rev 145707)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTree.pro        2013-03-13 12:48:47 UTC (rev 145708)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">     $$PWD/../WorkQueue.h \
</span><span class="cx">     $$PWD/../DumpRenderTree.h \
</span><span class="cx">     $$PWD/../GCController.h \
</span><ins>+    $$PWD/../TextRunner.h \
</ins><span class="cx">     DumpRenderTreeQt.h \
</span><span class="cx">     EventSenderQt.h \
</span><span class="cx">     TextInputControllerQt.h \
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx">     $$PWD/../WorkQueue.cpp \
</span><span class="cx">     $$PWD/../DumpRenderTreeCommon.cpp \
</span><span class="cx">     $$PWD/../GCController.cpp \
</span><ins>+    $$PWD/../TestRunner.cpp \
</ins><span class="cx">     DumpRenderTreeQt.cpp \
</span><span class="cx">     EventSenderQt.cpp \
</span><span class="cx">     TextInputControllerQt.cpp \
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeqtDumpRenderTreeMaincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp (145707 => 145708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp        2013-03-13 12:48:28 UTC (rev 145707)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp        2013-03-13 12:48:47 UTC (rev 145708)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/AlwaysInline.h&gt;
</span><del>-#include &lt;wtf/ExportMacros.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #ifdef Q_WS_X11
</span><span class="cx"> #include &lt;qx11info_x11.h&gt;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeqtDumpRenderTreeQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp (145707 => 145708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp        2013-03-13 12:48:28 UTC (rev 145707)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp        2013-03-13 12:48:47 UTC (rev 145708)
</span><span class="lines">@@ -38,7 +38,9 @@
</span><span class="cx"> #include &quot;GCController.h&quot;
</span><span class="cx"> #include &quot;InitWebCoreQt.h&quot;
</span><span class="cx"> #include &quot;InitWebKitQt.h&quot;
</span><ins>+#include &quot;JSStringRefQt.h&quot;
</ins><span class="cx"> #include &quot;QtTestSupport.h&quot;
</span><ins>+#include &quot;TestRunner.h&quot;
</ins><span class="cx"> #include &quot;TestRunnerQt.h&quot;
</span><span class="cx"> #include &quot;TextInputControllerQt.h&quot;
</span><span class="cx"> #include &quot;testplugin.h&quot;
</span><span class="lines">@@ -524,6 +526,8 @@
</span><span class="cx">     // of the DRT.
</span><span class="cx">     m_controller-&gt;reset();
</span><span class="cx"> 
</span><ins>+    m_jscController = TestRunner::create(url.toString().toStdString(), m_expectedHash.toStdString());
+
</ins><span class="cx">     // reset mouse clicks counter
</span><span class="cx">     m_eventSender-&gt;resetClickCount();
</span><span class="cx"> 
</span><span class="lines">@@ -746,6 +750,40 @@
</span><span class="cx">     frame-&gt;addToJavaScriptWindowObject(QLatin1String(&quot;textInputController&quot;), m_textInputController);
</span><span class="cx">     m_gcController-&gt;makeWindowObject(context, window, 0);
</span><span class="cx"> 
</span><ins>+    if (m_jscController) {
+        JSObjectRef dummyWindow = JSObjectMake(context, 0, 0);
+        m_jscController-&gt;makeWindowObject(context, dummyWindow, 0);
+        JSRetainPtr&lt;JSStringRef&gt; testRunnerName(Adopt, JSStringCreateWithUTF8CString(&quot;testRunner&quot;));
+        JSValueRef wrappedTestRunner = JSObjectGetProperty(context, dummyWindow, testRunnerName.get(), 0);
+        JSRetainPtr&lt;JSStringRef&gt; helperScript(Adopt, JSStringCreateWithUTF8CString(&quot;(function() {\n&quot;
+                                                                                   &quot;    function bind(fun, thisArg) {\n&quot;
+                                                                                   &quot;        return function() {\n&quot;
+                                                                                   &quot;            return fun.apply(thisArg, Array.prototype.slice.call(arguments));\n&quot;
+                                                                                   &quot;        }\n&quot;
+                                                                                   &quot;    }\n&quot;
+                                                                                   &quot;for (var prop in this.jscBasedTestRunner) {\n&quot;
+                                                                                   &quot;    var pd = Object.getOwnPropertyDescriptor(this.qtBasedTestRunner, prop);\n&quot;
+                                                                                   &quot;    if (pd !== undefined) continue;\n&quot;
+                                                                                   &quot;    pd = Object.getOwnPropertyDescriptor(this.jscBasedTestRunner, prop);\n&quot;
+                                                                                   &quot;    this.qtBasedTestRunner[prop] = bind(this.jscBasedTestRunner[prop], this.jscBasedTestRunner);\n&quot;
+                                                                                   &quot;}\n&quot;
+                                                                                   &quot;}).apply(this)\n&quot;));
+
+        JSRetainPtr&lt;JSStringRef&gt; qtBasedTestRunnerName(Adopt, JSStringCreateWithUTF8CString(&quot;qtBasedTestRunner&quot;));
+        JSRetainPtr&lt;JSStringRef&gt; jscBasedTestRunnerName(Adopt, JSStringCreateWithUTF8CString(&quot;jscBasedTestRunner&quot;));
+
+        JSObjectRef args = JSObjectMake(context, 0, 0);
+        JSObjectSetProperty(context, args, qtBasedTestRunnerName.get(), JSObjectGetProperty(context, window, testRunnerName.get(), 0), 0, 0);
+        JSObjectSetProperty(context, args, jscBasedTestRunnerName.get(), wrappedTestRunner, 0, 0);
+
+        JSValueRef ex = 0;
+        JSEvaluateScript(context, helperScript.get(), args, 0, 0, &amp;ex);
+        if (ex) {
+            JSRetainPtr&lt;JSStringRef&gt; msg(Adopt, JSValueToStringCopy(context, ex, 0));
+            fprintf(stderr, &quot;Error evaluating TestRunner setup-script: %s\n&quot;, qPrintable(JSStringCopyQString(msg.get())));
+        }
+    }
+
</ins><span class="cx">     DumpRenderTreeSupportQt::injectInternalsObject(frame-&gt;handle());
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeqtDumpRenderTreeQth"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h (145707 => 145708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h        2013-03-13 12:48:28 UTC (rev 145707)
+++ trunk/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h        2013-03-13 12:48:47 UTC (rev 145708)
</span><span class="lines">@@ -41,12 +41,14 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DumpRenderTreeSupportQt.h&quot;
</span><ins>+#include &quot;TestRunner.h&quot;
</ins><span class="cx"> #include &lt;qgraphicsview.h&gt;
</span><span class="cx"> #include &lt;qgraphicswebview.h&gt;
</span><span class="cx"> #include &lt;qwebframe.h&gt;
</span><span class="cx"> #include &lt;qwebinspector.h&gt;
</span><span class="cx"> #include &lt;qwebpage.h&gt;
</span><span class="cx"> #include &lt;qwebview.h&gt;
</span><ins>+#include &lt;wtf/RefPtr.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> QT_BEGIN_NAMESPACE
</span><span class="cx"> class QUrl;
</span><span class="lines">@@ -144,6 +146,7 @@
</span><span class="cx">     QString dumpBackForwardList(QWebPage* page);
</span><span class="cx">     QString dumpFrameScrollPosition(QWebFrame* frame);
</span><span class="cx">     TestRunnerQt *m_controller;
</span><ins>+    RefPtr&lt;TestRunner&gt; m_jscController;
</ins><span class="cx"> 
</span><span class="cx">     bool m_dumpPixelsForCurrentTest;
</span><span class="cx">     bool m_dumpPixelsForAllTests;
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreeqtTestRunnerQtcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp (145707 => 145708)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp        2013-03-13 12:48:28 UTC (rev 145707)
+++ trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp        2013-03-13 12:48:47 UTC (rev 145708)
</span><span class="lines">@@ -48,6 +48,10 @@
</span><span class="cx">     reset();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TestRunner::~TestRunner()
+{
+}
+
</ins><span class="cx"> void TestRunnerQt::reset()
</span><span class="cx"> {
</span><span class="cx">     m_hasDumped = false;
</span><span class="lines">@@ -926,3 +930,427 @@
</span><span class="cx"> 
</span><span class="cx"> const unsigned TestRunnerQt::maxViewWidth = 800;
</span><span class="cx"> const unsigned TestRunnerQt::maxViewHeight = 600;
</span><ins>+
+// --- JSC C API stubs
+
+void TestRunner::addDisallowedURL(JSStringRef url)
+{
+}
+
+void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
+{
+}
+
+void TestRunner::removeAllVisitedLinks()
+{
+}
+
+void TestRunner::setAcceptsEditing(bool)
+{
+}
+
+void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title)
+{
+}
+
+void TestRunner::setWindowIsKey(bool)
+{
+}
+
+void TestRunner::setAlwaysAcceptCookies(bool)
+{
+}
+
+void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+}
+
+void TestRunner::setWebViewEditable(bool)
+{
+}
+
+void TestRunner::clearAllApplicationCaches()
+{
+}
+
+void TestRunner::setTextDirection(JSStringRef)
+{
+}
+
+void TestRunner::notifyDone()
+{
+}
+
+int TestRunner::numberOfPendingGeolocationPermissionRequests()
+{
+    return 0;
+}
+
+void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
+{
+}
+
+JSStringRef TestRunner::pathToLocalResource(JSContextRef, JSStringRef url)
+{
+    return JSStringCreateWithUTF8CString(0); // ### Take impl from WTR
+}
+
+void TestRunner::removeAllWebNotificationPermissions()
+{
+}
+
+void TestRunner::simulateWebNotificationClick(JSValueRef notification)
+{
+}
+
+void TestRunner::closeIdleLocalStorageDatabases()
+{
+}
+
+void TestRunner::focusWebView()
+{
+}
+
+void TestRunner::setBackingScaleFactor(double)
+{
+}
+
+void TestRunner::removeChromeInputField()
+{
+}
+
+void TestRunner::addChromeInputField()
+{
+}
+
+JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context)
+{
+    return JSValueMakeNull(context);
+}
+
+void TestRunner::deleteAllLocalStorage()
+{
+}
+
+void TestRunner::deleteLocalStorageForOrigin(JSStringRef originIdentifier)
+{
+}
+
+void TestRunner::observeStorageTrackerNotifications(unsigned number)
+{
+}
+
+void TestRunner::syncLocalStorage()
+{
+}
+
+int TestRunner::windowCount()
+{
+    return 0;
+}
+
+void TestRunner::setWaitToDump(bool)
+{
+}
+
+void TestRunner::waitForPolicyDelegate()
+{
+}
+
+size_t TestRunner::webHistoryItemCount()
+{
+    return 0;
+}
+
+void TestRunner::showWebInspector()
+{
+}
+
+void TestRunner::closeWebInspector()
+{
+}
+
+void TestRunner::evaluateInWebInspector(long callId, JSStringRef script)
+{
+}
+
+void TestRunner::setSerializeHTTPLoads(bool)
+{
+}
+
+void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+}
+
+void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive)
+{
+}
+
+void TestRunner::setDatabaseQuota(unsigned long long quota)
+{
+}
+
+void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme)
+{
+}
+
+void TestRunner::resetPageVisibility()
+{
+}
+
+void TestRunner::keepWebHistory()
+{
+}
+
+void TestRunner::goBack()
+{
+}
+
+JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context)
+{
+    return JSValueMakeNull(context);
+}
+
+long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name)
+{
+    return 0;
+}
+
+void TestRunner::display()
+{
+}
+
+void TestRunner::dispatchPendingLoadRequests()
+{
+}
+
+void TestRunner::clearPersistentUserStyleSheet()
+{
+}
+
+bool TestRunner::callShouldCloseOnWebView()
+{
+    return false;
+}
+
+JSStringRef TestRunner::copyDecodedHostName(JSStringRef name)
+{
+    return JSStringCreateWithUTF8CString(0);
+}
+
+void TestRunner::clearBackForwardList()
+{
+}
+
+void TestRunner::clearAllDatabases()
+{
+}
+
+void TestRunner::clearApplicationCacheForOrigin(JSStringRef name)
+{
+}
+
+void TestRunner::apiTestGoToCurrentBackForwardItem()
+{
+}
+
+void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
+{
+}
+
+void TestRunner::abortModal()
+{
+}
+
+void TestRunner::setStorageDatabaseIdleInterval(double)
+{
+}
+
+void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
+{
+}
+
+void TestRunner::setXSSAuditorEnabled(bool flag)
+{
+}
+
+void TestRunner::setSpatialNavigationEnabled(bool)
+{
+}
+
+void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+}
+
+void TestRunner::setJavaScriptCanAccessClipboard(bool flag)
+{
+}
+
+void TestRunner::setAutomaticLinkDetectionEnabled(bool flag)
+{
+}
+
+void TestRunner::setUserStyleSheetEnabled(bool flag)
+{
+}
+
+void TestRunner::setUserStyleSheetLocation(JSStringRef path)
+{
+}
+
+void TestRunner::setUseDashboardCompatibilityMode(bool flag)
+{
+}
+
+void TestRunner::setTabKeyCyclesThroughElements(bool)
+{
+}
+
+void TestRunner::setSmartInsertDeleteEnabled(bool)
+{
+}
+
+void TestRunner::setSelectTrailingWhitespaceEnabled(bool)
+{
+}
+
+void TestRunner::setPrivateBrowsingEnabled(bool)
+{
+}
+
+void TestRunner::setPluginsEnabled(bool)
+{
+}
+
+void TestRunner::setPopupBlockingEnabled(bool)
+{
+}
+
+void TestRunner::setMockSpeechInputDumpRect(bool flag)
+{
+}
+
+void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef path)
+{
+}
+
+void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
+{
+}
+
+void TestRunner::setMockGeolocationPositionUnavailableError(JSStringRef message)
+{
+}
+
+void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+}
+
+void TestRunner::setMainFrameIsFirstResponder(bool flag)
+{
+}
+
+void TestRunner::setIconDatabaseEnabled(bool)
+{
+}
+
+void TestRunner::setGeolocationPermission(bool allow)
+{
+}
+
+void TestRunner::setDefersLoading(bool)
+{
+}
+
+void TestRunner::setCacheModel(int)
+{
+}
+
+void TestRunner::setAuthorAndUserStylesEnabled(bool)
+{
+}
+
+void TestRunner::setAllowFileAccessFromFileURLs(bool)
+{
+}
+
+void TestRunner::setAppCacheMaximumSize(unsigned long long quota)
+{
+}
+
+void TestRunner::setAllowUniversalAccessFromFileURLs(bool)
+{
+}
+
+void TestRunner::setApplicationCacheOriginQuota(unsigned long long)
+{
+}
+
+void TestRunner::denyWebNotificationPermission(JSStringRef origin)
+{
+}
+
+void TestRunner::grantWebNotificationPermission(JSStringRef origin)
+{
+}
+
+void TestRunner::setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value)
+{
+}
+
+void TestRunner::setViewModeMediaFeature(JSStringRef)
+{
+}
+
+void TestRunner::setPageVisibility(const char *)
+{
+}
+
+void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language)
+{
+}
+
+void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+}
+
+void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+{
+}
+
+bool TestRunner::isCommandEnabled(JSStringRef name)
+{
+    return false;
+}
+
+void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+{
+}
+
+void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script)
+{
+}
+
+JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
+{
+    return JSStringCreateWithUTF8CString(0);
+}
+
+void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
+{
+}
+
+bool TestRunner::findString(JSContextRef, JSStringRef, JSObjectRef optionsArray)
+{
+    return false;
+}
+
+void TestRunner::execCommand(JSStringRef name, JSStringRef value)
+{
+}
+
+long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier)
+{
+    return 0;
+}
+
</ins></span></pre>
</div>
</div>

</body>
</html>