[Qt] Port GCController to JSC C API
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 09:44:19 +0000 (09:44 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Feb 2013 09:44:19 +0000 (09:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109690

Patch by Simon Hausmann <simon.hausmann@digia.com> on 2013-02-15
Reviewed by Benjamin Poulain.

Source/WebKit/qt:

Add hooks to retrieve JSContextRef and window object.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::getJSWindowObject):
* WebCoreSupport/DumpRenderTreeSupportQt.h:

Tools:

Rename TestRunner to TestRunnerQt to avoid conflict when
including TestRunner.h in the future.

Replaced QObject based GCController implementation with JSC C API
based one.

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
(WebCore::DumpRenderTree::open):
(WebCore::DumpRenderTree::initJSObjects):
(WebCore::methodNameStringForFailedTest):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(WebCore::DumpRenderTree::testRunner):
(DumpRenderTree):
* DumpRenderTree/qt/GCControllerQt.cpp:
(GCController::getJSObjectCount):
* DumpRenderTree/qt/GCControllerQt.h: Removed.
* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunnerQt::TestRunnerQt):
(TestRunnerQt::reset):
(TestRunnerQt::dumpNotifications):
(TestRunnerQt::processWork):
(TestRunnerQt::maybeDump):
(TestRunnerQt::dumpAsText):
(TestRunnerQt::waitUntilDone):
(TestRunnerQt::setViewModeMediaFeature):
(TestRunnerQt::webHistoryItemCount):
(TestRunnerQt::keepWebHistory):
(TestRunnerQt::notifyDone):
(TestRunnerQt::windowCount):
(TestRunnerQt::grantWebNotificationPermission):
(TestRunnerQt::ignoreLegacyWebNotificationPermissionRequests):
(TestRunnerQt::denyWebNotificationPermission):
(TestRunnerQt::removeAllWebNotificationPermissions):
(TestRunnerQt::simulateWebNotificationClick):
(TestRunnerQt::simulateLegacyWebNotificationClick):
(TestRunnerQt::display):
(TestRunnerQt::displayInvalidatedRegion):
(TestRunnerQt::clearBackForwardList):
(TestRunnerQt::pathToLocalResource):
(TestRunnerQt::dumpEditingCallbacks):
(TestRunnerQt::dumpFrameLoadCallbacks):
(TestRunnerQt::dumpProgressFinishedCallback):
(TestRunnerQt::dumpUserGestureInFrameLoadCallbacks):
(TestRunnerQt::dumpResourceLoadCallbacks):
(TestRunnerQt::dumpResourceResponseMIMETypes):
(TestRunnerQt::dumpWillCacheResponse):
(TestRunnerQt::dumpHistoryCallbacks):
(TestRunnerQt::setWillSendRequestReturnsNullOnRedirect):
(TestRunnerQt::setWillSendRequestReturnsNull):
(TestRunnerQt::setWillSendRequestClearHeader):
(TestRunnerQt::setDeferMainResourceDataLoad):
(TestRunnerQt::queueBackNavigation):
(TestRunnerQt::queueForwardNavigation):
(TestRunnerQt::queueLoad):
(TestRunnerQt::queueLoadHTMLString):
(TestRunnerQt::queueReload):
(TestRunnerQt::queueLoadingScript):
(TestRunnerQt::queueNonLoadingScript):
(TestRunnerQt::provisionalLoad):
(TestRunnerQt::timerEvent):
(TestRunnerQt::encodeHostName):
(TestRunnerQt::decodeHostName):
(TestRunnerQt::closeWebInspector):
(TestRunnerQt::setDeveloperExtrasEnabled):
(TestRunnerQt::setAsynchronousSpellCheckingEnabled):
(TestRunnerQt::showWebInspector):
(TestRunnerQt::evaluateInWebInspector):
(TestRunnerQt::goBack):
(TestRunnerQt::setDefersLoading):
(TestRunnerQt::setAllowUniversalAccessFromFileURLs):
(TestRunnerQt::setAllowFileAccessFromFileURLs):
(TestRunnerQt::setAppCacheMaximumSize):
(TestRunnerQt::setAutofilled):
(TestRunnerQt::setValueForUser):
(TestRunnerQt::setFixedContentsSize):
(TestRunnerQt::setPrivateBrowsingEnabled):
(TestRunnerQt::setSpatialNavigationEnabled):
(TestRunnerQt::setPopupBlockingEnabled):
(TestRunnerQt::setPluginsEnabled):
(TestRunnerQt::setPOSIXLocale):
(TestRunnerQt::setWindowIsKey):
(TestRunnerQt::setMainFrameIsFirstResponder):
(TestRunnerQt::setJavaScriptCanAccessClipboard):
(TestRunnerQt::setXSSAuditorEnabled):
(TestRunnerQt::dispatchPendingLoadRequests):
(TestRunnerQt::clearAllApplicationCaches):
(TestRunnerQt::clearApplicationCacheForOrigin):
(TestRunnerQt::localStorageDiskUsageForOrigin):
(TestRunnerQt::setApplicationCacheOriginQuota):
(TestRunnerQt::applicationCacheDiskUsageForOrigin):
(TestRunnerQt::originsWithApplicationCache):
(TestRunnerQt::setCacheModel):
(TestRunnerQt::setDatabaseQuota):
(TestRunnerQt::clearAllDatabases):
(TestRunnerQt::addOriginAccessWhitelistEntry):
(TestRunnerQt::removeOriginAccessWhitelistEntry):
(TestRunnerQt::setCustomPolicyDelegate):
(TestRunnerQt::waitForPolicyDelegate):
(TestRunnerQt::overridePreference):
(TestRunnerQt::setUserStyleSheetLocation):
(TestRunnerQt::setCaretBrowsingEnabled):
(TestRunnerQt::setAuthorAndUserStylesEnabled):
(TestRunnerQt::setUserStyleSheetEnabled):
(TestRunnerQt::setDomainRelaxationForbiddenForURLScheme):
(TestRunnerQt::callShouldCloseOnWebView):
(TestRunnerQt::setScrollbarPolicy):
(TestRunnerQt::setSmartInsertDeleteEnabled):
(TestRunnerQt::setSelectTrailingWhitespaceEnabled):
(TestRunnerQt::execCommand):
(TestRunnerQt::isCommandEnabled):
(TestRunnerQt::findString):
(TestRunnerQt::markerTextForListItem):
(TestRunnerQt::computedStyleIncludingVisitedInfo):
(TestRunnerQt::elementDoesAutoCompleteForElementWithId):
(TestRunnerQt::authenticateSession):
(TestRunnerQt::setIconDatabaseEnabled):
(TestRunnerQt::setMockDeviceOrientation):
(TestRunnerQt::setGeolocationPermission):
(TestRunnerQt::numberOfPendingGeolocationPermissionRequests):
(TestRunnerQt::setGeolocationPermissionCommon):
(TestRunnerQt::setMockGeolocationPositionUnavailableError):
(TestRunnerQt::setMockGeolocationPosition):
(TestRunnerQt::addMockSpeechInputResult):
(TestRunnerQt::setMockSpeechInputDumpRect):
(TestRunnerQt::startSpeechInput):
(TestRunnerQt::evaluateScriptInIsolatedWorldAndReturnValue):
(TestRunnerQt::evaluateScriptInIsolatedWorld):
(TestRunnerQt::addUserStyleSheet):
(TestRunnerQt::removeAllVisitedLinks):
(TestRunnerQt::addURLToRedirect):
(TestRunnerQt::originsWithLocalStorage):
(TestRunnerQt::deleteAllLocalStorage):
(TestRunnerQt::deleteLocalStorageForOrigin):
(TestRunnerQt::observeStorageTrackerNotifications):
(TestRunnerQt::syncLocalStorage):
(TestRunnerQt::resetPageVisibility):
(TestRunnerQt::setPageVisibility):
(TestRunnerQt::setAutomaticLinkDetectionEnabled):
(TestRunnerQt::setTextDirection):
(TestRunnerQt::setAlwaysAcceptCookies):
(TestRunnerQt::setAlwaysBlockCookies):
(TestRunnerQt::setAudioData):
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunnerQt):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142972 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
Tools/ChangeLog
Tools/DumpRenderTree/qt/DumpRenderTree.pro
Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
Tools/DumpRenderTree/qt/DumpRenderTreeQt.h
Tools/DumpRenderTree/qt/GCControllerQt.cpp
Tools/DumpRenderTree/qt/GCControllerQt.h [deleted file]
Tools/DumpRenderTree/qt/TestRunnerQt.cpp
Tools/DumpRenderTree/qt/TestRunnerQt.h

index 90e84ebee8a8950f93a90980aa06e728955a7a47..e60d70b5d52e0276317bf4c3df3d494d04d5e35e 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-15  Simon Hausmann  <simon.hausmann@digia.com>
+
+        [Qt] Port GCController to JSC C API
+        https://bugs.webkit.org/show_bug.cgi?id=109690
+
+        Reviewed by Benjamin Poulain.
+
+        Add hooks to retrieve JSContextRef and window object.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::getJSWindowObject):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
 2013-02-13  Allan Sandfeld Jensen  <allan.jensen@digia.com>
 
         [Qt] window.open passes height and width parameters even if not defined in a page
index 5c3625ab6a617afe925dc5e51fdd0bf9986974de..07528b01f96378c0450c8e9b1f94576a0ff68352 100644 (file)
@@ -992,3 +992,10 @@ void DumpRenderTreeSupportQt::clearNotificationPermissions()
     WebCore::NotificationPresenterClientQt::notificationPresenter()->clearCachedPermissions();
 #endif
 }
+
+void DumpRenderTreeSupportQt::getJSWindowObject(QWebFrameAdapter* adapter, JSContextRef* context, JSObjectRef* object)
+{
+    JSDOMWindow* window = toJSDOMWindow(adapter->frame, mainThreadNormalWorld());
+    *object = toRef(window);
+    *context = toRef(window->globalExec());
+}
index ec7b17b02ae64a786b31e525d5cebb7fb990cd10..401d9b629f103ae05262b4d7fe50c5996ad39617 100644 (file)
@@ -29,6 +29,7 @@
 #include <QVector>
 
 typedef const struct OpaqueJSContext* JSContextRef;
+typedef struct OpaqueJSValue* JSObjectRef;
 
 namespace WebCore {
 class Text;
@@ -209,6 +210,8 @@ public:
 
     static QString frameRenderTreeDump(QWebFrameAdapter*);
     static void clearNotificationPermissions();
+
+    static void getJSWindowObject(QWebFrameAdapter*, JSContextRef*, JSObjectRef*);
 };
 
 #endif
index 506e4101483bd3b221db8c5e91278adad2442df1..613455e9e5368b18f456bdbe340052126cb770b8 100644 (file)
@@ -1,3 +1,157 @@
+2013-02-15  Simon Hausmann  <simon.hausmann@digia.com>
+
+        [Qt] Port GCController to JSC C API
+        https://bugs.webkit.org/show_bug.cgi?id=109690
+
+        Reviewed by Benjamin Poulain.
+
+        Rename TestRunner to TestRunnerQt to avoid conflict when
+        including TestRunner.h in the future.
+
+        Replaced QObject based GCController implementation with JSC C API
+        based one.
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::open):
+        (WebCore::DumpRenderTree::initJSObjects):
+        (WebCore::methodNameStringForFailedTest):
+        * DumpRenderTree/qt/DumpRenderTreeQt.h:
+        (WebCore::DumpRenderTree::testRunner):
+        (DumpRenderTree):
+        * DumpRenderTree/qt/GCControllerQt.cpp:
+        (GCController::getJSObjectCount):
+        * DumpRenderTree/qt/GCControllerQt.h: Removed.
+        * DumpRenderTree/qt/TestRunnerQt.cpp:
+        (TestRunnerQt::TestRunnerQt):
+        (TestRunnerQt::reset):
+        (TestRunnerQt::dumpNotifications):
+        (TestRunnerQt::processWork):
+        (TestRunnerQt::maybeDump):
+        (TestRunnerQt::dumpAsText):
+        (TestRunnerQt::waitUntilDone):
+        (TestRunnerQt::setViewModeMediaFeature):
+        (TestRunnerQt::webHistoryItemCount):
+        (TestRunnerQt::keepWebHistory):
+        (TestRunnerQt::notifyDone):
+        (TestRunnerQt::windowCount):
+        (TestRunnerQt::grantWebNotificationPermission):
+        (TestRunnerQt::ignoreLegacyWebNotificationPermissionRequests):
+        (TestRunnerQt::denyWebNotificationPermission):
+        (TestRunnerQt::removeAllWebNotificationPermissions):
+        (TestRunnerQt::simulateWebNotificationClick):
+        (TestRunnerQt::simulateLegacyWebNotificationClick):
+        (TestRunnerQt::display):
+        (TestRunnerQt::displayInvalidatedRegion):
+        (TestRunnerQt::clearBackForwardList):
+        (TestRunnerQt::pathToLocalResource):
+        (TestRunnerQt::dumpEditingCallbacks):
+        (TestRunnerQt::dumpFrameLoadCallbacks):
+        (TestRunnerQt::dumpProgressFinishedCallback):
+        (TestRunnerQt::dumpUserGestureInFrameLoadCallbacks):
+        (TestRunnerQt::dumpResourceLoadCallbacks):
+        (TestRunnerQt::dumpResourceResponseMIMETypes):
+        (TestRunnerQt::dumpWillCacheResponse):
+        (TestRunnerQt::dumpHistoryCallbacks):
+        (TestRunnerQt::setWillSendRequestReturnsNullOnRedirect):
+        (TestRunnerQt::setWillSendRequestReturnsNull):
+        (TestRunnerQt::setWillSendRequestClearHeader):
+        (TestRunnerQt::setDeferMainResourceDataLoad):
+        (TestRunnerQt::queueBackNavigation):
+        (TestRunnerQt::queueForwardNavigation):
+        (TestRunnerQt::queueLoad):
+        (TestRunnerQt::queueLoadHTMLString):
+        (TestRunnerQt::queueReload):
+        (TestRunnerQt::queueLoadingScript):
+        (TestRunnerQt::queueNonLoadingScript):
+        (TestRunnerQt::provisionalLoad):
+        (TestRunnerQt::timerEvent):
+        (TestRunnerQt::encodeHostName):
+        (TestRunnerQt::decodeHostName):
+        (TestRunnerQt::closeWebInspector):
+        (TestRunnerQt::setDeveloperExtrasEnabled):
+        (TestRunnerQt::setAsynchronousSpellCheckingEnabled):
+        (TestRunnerQt::showWebInspector):
+        (TestRunnerQt::evaluateInWebInspector):
+        (TestRunnerQt::goBack):
+        (TestRunnerQt::setDefersLoading):
+        (TestRunnerQt::setAllowUniversalAccessFromFileURLs):
+        (TestRunnerQt::setAllowFileAccessFromFileURLs):
+        (TestRunnerQt::setAppCacheMaximumSize):
+        (TestRunnerQt::setAutofilled):
+        (TestRunnerQt::setValueForUser):
+        (TestRunnerQt::setFixedContentsSize):
+        (TestRunnerQt::setPrivateBrowsingEnabled):
+        (TestRunnerQt::setSpatialNavigationEnabled):
+        (TestRunnerQt::setPopupBlockingEnabled):
+        (TestRunnerQt::setPluginsEnabled):
+        (TestRunnerQt::setPOSIXLocale):
+        (TestRunnerQt::setWindowIsKey):
+        (TestRunnerQt::setMainFrameIsFirstResponder):
+        (TestRunnerQt::setJavaScriptCanAccessClipboard):
+        (TestRunnerQt::setXSSAuditorEnabled):
+        (TestRunnerQt::dispatchPendingLoadRequests):
+        (TestRunnerQt::clearAllApplicationCaches):
+        (TestRunnerQt::clearApplicationCacheForOrigin):
+        (TestRunnerQt::localStorageDiskUsageForOrigin):
+        (TestRunnerQt::setApplicationCacheOriginQuota):
+        (TestRunnerQt::applicationCacheDiskUsageForOrigin):
+        (TestRunnerQt::originsWithApplicationCache):
+        (TestRunnerQt::setCacheModel):
+        (TestRunnerQt::setDatabaseQuota):
+        (TestRunnerQt::clearAllDatabases):
+        (TestRunnerQt::addOriginAccessWhitelistEntry):
+        (TestRunnerQt::removeOriginAccessWhitelistEntry):
+        (TestRunnerQt::setCustomPolicyDelegate):
+        (TestRunnerQt::waitForPolicyDelegate):
+        (TestRunnerQt::overridePreference):
+        (TestRunnerQt::setUserStyleSheetLocation):
+        (TestRunnerQt::setCaretBrowsingEnabled):
+        (TestRunnerQt::setAuthorAndUserStylesEnabled):
+        (TestRunnerQt::setUserStyleSheetEnabled):
+        (TestRunnerQt::setDomainRelaxationForbiddenForURLScheme):
+        (TestRunnerQt::callShouldCloseOnWebView):
+        (TestRunnerQt::setScrollbarPolicy):
+        (TestRunnerQt::setSmartInsertDeleteEnabled):
+        (TestRunnerQt::setSelectTrailingWhitespaceEnabled):
+        (TestRunnerQt::execCommand):
+        (TestRunnerQt::isCommandEnabled):
+        (TestRunnerQt::findString):
+        (TestRunnerQt::markerTextForListItem):
+        (TestRunnerQt::computedStyleIncludingVisitedInfo):
+        (TestRunnerQt::elementDoesAutoCompleteForElementWithId):
+        (TestRunnerQt::authenticateSession):
+        (TestRunnerQt::setIconDatabaseEnabled):
+        (TestRunnerQt::setMockDeviceOrientation):
+        (TestRunnerQt::setGeolocationPermission):
+        (TestRunnerQt::numberOfPendingGeolocationPermissionRequests):
+        (TestRunnerQt::setGeolocationPermissionCommon):
+        (TestRunnerQt::setMockGeolocationPositionUnavailableError):
+        (TestRunnerQt::setMockGeolocationPosition):
+        (TestRunnerQt::addMockSpeechInputResult):
+        (TestRunnerQt::setMockSpeechInputDumpRect):
+        (TestRunnerQt::startSpeechInput):
+        (TestRunnerQt::evaluateScriptInIsolatedWorldAndReturnValue):
+        (TestRunnerQt::evaluateScriptInIsolatedWorld):
+        (TestRunnerQt::addUserStyleSheet):
+        (TestRunnerQt::removeAllVisitedLinks):
+        (TestRunnerQt::addURLToRedirect):
+        (TestRunnerQt::originsWithLocalStorage):
+        (TestRunnerQt::deleteAllLocalStorage):
+        (TestRunnerQt::deleteLocalStorageForOrigin):
+        (TestRunnerQt::observeStorageTrackerNotifications):
+        (TestRunnerQt::syncLocalStorage):
+        (TestRunnerQt::resetPageVisibility):
+        (TestRunnerQt::setPageVisibility):
+        (TestRunnerQt::setAutomaticLinkDetectionEnabled):
+        (TestRunnerQt::setTextDirection):
+        (TestRunnerQt::setAlwaysAcceptCookies):
+        (TestRunnerQt::setAlwaysBlockCookies):
+        (TestRunnerQt::setAudioData):
+        * DumpRenderTree/qt/TestRunnerQt.h:
+        (TestRunnerQt):
+
 2013-02-14  Karen Grunberg  <kareng@chromium.org>
 
         adding myself as a committer
index 2671ab664d16f478e750227caa34be09d8d936e8..a2f85632c64cc5b753f75c07d7658f116b10d3f7 100644 (file)
@@ -26,17 +26,18 @@ macx: QT += xml
 HEADERS += \
     $$PWD/../WorkQueue.h \
     $$PWD/../DumpRenderTree.h \
+    $$PWD/../GCController.h \
     DumpRenderTreeQt.h \
     EventSenderQt.h \
     TextInputControllerQt.h \
     WorkQueueItemQt.h \
     TestRunnerQt.h \
-    GCControllerQt.h \
     testplugin.h
 
 SOURCES += \
     $$PWD/../WorkQueue.cpp \
     $$PWD/../DumpRenderTreeCommon.cpp \
+    $$PWD/../GCController.cpp \
     DumpRenderTreeQt.cpp \
     EventSenderQt.cpp \
     TextInputControllerQt.cpp \
index ac736eae8c79b537c7580592abb13fd1374a408e..23fd35c1c6fb5f17933b6532bd4c8741700e8cd2 100755 (executable)
@@ -35,7 +35,7 @@
 #include "DumpRenderTreeQt.h"
 #include "DumpRenderTreeSupportQt.h"
 #include "EventSenderQt.h"
-#include "GCControllerQt.h"
+#include "GCController.h"
 #include "InitWebCoreQt.h"
 #include "InitWebKitQt.h"
 #include "QtTestSupport.h"
@@ -422,7 +422,7 @@ DumpRenderTree::DumpRenderTree()
     DumpRenderTreeSupportQt::webPageSetGroupName(pageAdapter(), "org.webkit.qt.DumpRenderTree");
 
     m_mainView->setContextMenuPolicy(Qt::NoContextMenu);
-    m_mainView->resize(QSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight));
+    m_mainView->resize(QSize(TestRunnerQt::maxViewWidth, TestRunnerQt::maxViewHeight));
 
     // clean up cache by resetting quota.
     qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota();
@@ -430,7 +430,7 @@ DumpRenderTree::DumpRenderTree()
 
     // create our controllers. This has to be done before connectFrame,
     // as it exports there to the JavaScript DOM window.
-    m_controller = new TestRunner(this);
+    m_controller = new TestRunnerQt(this);
     connect(m_controller, SIGNAL(showPage()), this, SLOT(showPage()));
     connect(m_controller, SIGNAL(hidePage()), this, SLOT(hidePage()));
 
@@ -440,7 +440,7 @@ DumpRenderTree::DumpRenderTree()
     connect(m_controller, SIGNAL(done()), this, SLOT(dump()));
     m_eventSender = new EventSender(m_page);
     m_textInputController = new TextInputController(m_page);
-    m_gcController = new GCController(m_page);
+    m_gcController.reset(new GCController());
 
     // now connect our different signals
     connect(m_page, SIGNAL(frameCreated(QWebFrame *)),
@@ -612,8 +612,8 @@ void DumpRenderTree::open(const QUrl& url)
 
     // W3C SVG tests expect to be 480x360
     bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1");
-    int width = isW3CTest ? 480 : TestRunner::maxViewWidth;
-    int height = isW3CTest ? 360 : TestRunner::maxViewHeight;
+    int width = isW3CTest ? 480 : TestRunnerQt::maxViewWidth;
+    int height = isW3CTest ? 360 : TestRunnerQt::maxViewHeight;
     m_mainView->resize(QSize(width, height));
     m_page->setPreferredContentsSize(QSize());
     m_page->setViewportSize(QSize(width, height));
@@ -735,10 +735,17 @@ void DumpRenderTree::initJSObjects()
 {
     QWebFrame *frame = qobject_cast<QWebFrame*>(sender());
     Q_ASSERT(frame);
+
+    JSContextRef context = 0;
+    JSObjectRef window = 0;
+
+    DumpRenderTreeSupportQt::getJSWindowObject(frame->handle(), &context, &window);
+
     frame->addToJavaScriptWindowObject(QLatin1String("testRunner"), m_controller);
     frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), m_eventSender);
     frame->addToJavaScriptWindowObject(QLatin1String("textInputController"), m_textInputController);
-    frame->addToJavaScriptWindowObject(QLatin1String("GCController"), m_gcController);
+    m_gcController->makeWindowObject(context, window, 0);
+
     DumpRenderTreeSupportQt::injectInternalsObject(frame->handle());
 }
 
@@ -878,7 +885,7 @@ QString DumpRenderTree::dumpBackForwardList(QWebPage* page)
     return result;
 }
 
-static const char *methodNameStringForFailedTest(TestRunner *controller)
+static const char *methodNameStringForFailedTest(TestRunnerQt *controller)
 {
     const char *errorMessage;
     if (controller->shouldDumpAsText())
index 7a6f76fb0a2de2773898e2faf07969cda74ae7e6..dc5500a417709019757905ef8f16c9d496812780 100644 (file)
@@ -56,7 +56,7 @@ QT_END_NAMESPACE
 class QWebFrameAdapter;
 class QWebPageAdapter;
 
-class TestRunner;
+class TestRunnerQt;
 class DumpRenderTreeSupportQt;
 class EventSender;
 class TextInputController;
@@ -86,7 +86,7 @@ public:
     void closeRemainingWindows();
     void resetToConsistentStateBeforeTesting(const QUrl&);
 
-    TestRunner *testRunner() const { return m_controller; }
+    TestRunnerQt *testRunner() const { return m_controller; }
     EventSender *eventSender() const { return m_eventSender; }
     TextInputController *textInputController() const { return m_textInputController; }
     QString persistentStoragePath() const { return m_persistentStoragePath; }
@@ -143,7 +143,7 @@ private:
     QString dumpFramesAsText(QWebFrame* frame);
     QString dumpBackForwardList(QWebPage* page);
     QString dumpFrameScrollPosition(QWebFrame* frame);
-    TestRunner *m_controller;
+    TestRunnerQt *m_controller;
 
     bool m_dumpPixelsForCurrentTest;
     bool m_dumpPixelsForAllTests;
@@ -155,7 +155,7 @@ private:
 
     EventSender *m_eventSender;
     TextInputController *m_textInputController;
-    GCController* m_gcController;
+    QScopedPointer<GCController> m_gcController;
     NetworkAccessManager* m_networkAccessManager;
 
     QFile *m_stdin;
index a2e5e0c85dafe0fedb52ef5c3af2a6434afae278..9f93698d778f39e3e744fe7ce0e16f04971f0fea 100644 (file)
  */
 
 #include "config.h"
-#include "GCControllerQt.h"
-#include "DumpRenderTreeSupportQt.h"
-
-#include <qwebpage.h>
+#include "GCController.h"
 
-GCController::GCController(QWebPage* parent)
-    : QObject(parent)
-{
-}
+#include "DumpRenderTreeSupportQt.h"
 
 void GCController::collect() const
 {
@@ -48,7 +42,7 @@ void GCController::collectOnAlternateThread(bool waitUntilDone) const
     DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(waitUntilDone);
 }
 
-unsigned int GCController::getJSObjectCount() const
+size_t GCController::getJSObjectCount() const
 {
     return DumpRenderTreeSupportQt::javaScriptObjectsCount();
 }
diff --git a/Tools/DumpRenderTree/qt/GCControllerQt.h b/Tools/DumpRenderTree/qt/GCControllerQt.h
deleted file mode 100644 (file)
index bcc9f23..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef GCControllerQt_h
-#define GCControllerQt_h
-
-#include <QObject>
-
-class QWebPage;
-class DumpRenderTreeSupportQt;
-
-class GCController : public QObject
-{
-    Q_OBJECT
-public:
-    GCController(QWebPage* parent);
-
-public Q_SLOTS:
-    void collect() const;
-    void collectOnAlternateThread(bool waitUntilDone) const;
-    unsigned int getJSObjectCount() const;
-
-};
-
-#endif
index 7529c2b5385b750d3421f49ecd2dfdce8f22126d..2d7f3bf341d629b2a80b7d980060ccf0bdb74771 100644 (file)
@@ -39,7 +39,7 @@
 #include <QLocale>
 #include <qwebsettings.h>
 
-TestRunner::TestRunner(WebCore::DumpRenderTree* drt)
+TestRunnerQt::TestRunnerQt(WebCore::DumpRenderTree* drt)
     : QObject()
     , m_drt(drt)
     , m_shouldTimeout(true)
@@ -48,7 +48,7 @@ TestRunner::TestRunner(WebCore::DumpRenderTree* drt)
     reset();
 }
 
-void TestRunner::reset()
+void TestRunnerQt::reset()
 {
     m_hasDumped = false;
     m_loadFinished = false;
@@ -103,12 +103,12 @@ void TestRunner::reset()
     emit hidePage();
 }
 
-void TestRunner::dumpNotifications()
+void TestRunnerQt::dumpNotifications()
 {
     DumpRenderTreeSupportQt::dumpNotification(true);
 }
 
-void TestRunner::processWork()
+void TestRunnerQt::processWork()
 {
     // qDebug() << ">>>processWork";
 
@@ -120,7 +120,7 @@ void TestRunner::processWork()
 }
 
 // Called on loadFinished on WebPage
-void TestRunner::maybeDump(bool /*success*/)
+void TestRunnerQt::maybeDump(bool /*success*/)
 {
 
     // This can happen on any of the http/tests/security/window-events-*.html tests, where the test opens
@@ -151,13 +151,13 @@ void TestRunner::maybeDump(bool /*success*/)
     }
 }
 
-void TestRunner::dumpAsText(bool shouldDumpPixels)
+void TestRunnerQt::dumpAsText(bool shouldDumpPixels)
 {
     m_textDump = true;
     m_shouldDumpPixels = shouldDumpPixels;
 }
 
-void TestRunner::waitUntilDone()
+void TestRunnerQt::waitUntilDone()
 {
     //qDebug() << ">>>>waitForDone";
     m_waitForDone = true;
@@ -168,12 +168,12 @@ void TestRunner::waitUntilDone()
     m_timeoutTimer.start(m_timeout, this);
 }
 
-void TestRunner::setViewModeMediaFeature(const QString& mode)
+void TestRunnerQt::setViewModeMediaFeature(const QString& mode)
 {
     m_drt->webPage()->setProperty("_q_viewMode", mode);
 }
 
-int TestRunner::webHistoryItemCount()
+int TestRunnerQt::webHistoryItemCount()
 {
     if (!m_webHistory)
         return -1;
@@ -183,12 +183,12 @@ int TestRunner::webHistoryItemCount()
     return m_webHistory->count() - 1;
 }
 
-void TestRunner::keepWebHistory()
+void TestRunnerQt::keepWebHistory()
 {
     m_webHistory = m_drt->webPage()->history();
 }
 
-void TestRunner::notifyDone()
+void TestRunnerQt::notifyDone()
 {
     qDebug() << ">>>>notifyDone";
 
@@ -212,60 +212,60 @@ void TestRunner::notifyDone()
     m_waitForPolicy = false;
 }
 
-int TestRunner::windowCount()
+int TestRunnerQt::windowCount()
 {
     return m_drt->windowCount();
 }
 
-void TestRunner::grantWebNotificationPermission(const QString& origin)
+void TestRunnerQt::grantWebNotificationPermission(const QString& origin)
 {
     QWebFrame* frame = m_drt->webPage()->mainFrame();
     m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser);
 }
 
-void TestRunner::ignoreLegacyWebNotificationPermissionRequests()
+void TestRunnerQt::ignoreLegacyWebNotificationPermissionRequests()
 {
     m_ignoreDesktopNotification = true;
 }
 
-void TestRunner::denyWebNotificationPermission(const QString& origin)
+void TestRunnerQt::denyWebNotificationPermission(const QString& origin)
 {
     QWebFrame* frame = m_drt->webPage()->mainFrame();
     m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionDeniedByUser);
 }
 
-void TestRunner::removeAllWebNotificationPermissions()
+void TestRunnerQt::removeAllWebNotificationPermissions()
 {
     DumpRenderTreeSupportQt::clearNotificationPermissions();
 }
 
-void TestRunner::simulateWebNotificationClick(const QWebElement& notification)
+void TestRunnerQt::simulateWebNotificationClick(const QWebElement& notification)
 {
     // FIXME: implement.
 }
 
-void TestRunner::simulateLegacyWebNotificationClick(const QString& title)
+void TestRunnerQt::simulateLegacyWebNotificationClick(const QString& title)
 {
     DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title);
 }
 
-void TestRunner::display()
+void TestRunnerQt::display()
 {
     DumpRenderTreeSupportQt::setTrackRepaintRects(m_topLoadingFrame->handle(), true);
     emit showPage();
 }
 
-void TestRunner::displayInvalidatedRegion()
+void TestRunnerQt::displayInvalidatedRegion()
 {
     display();
 }
 
-void TestRunner::clearBackForwardList()
+void TestRunnerQt::clearBackForwardList()
 {
     m_drt->webPage()->history()->clear();
 }
 
-QString TestRunner::pathToLocalResource(const QString& url)
+QString TestRunnerQt::pathToLocalResource(const QString& url)
 {
     QString localTmpUrl(QLatin1String("file:///tmp/LayoutTests"));
 
@@ -282,82 +282,82 @@ QString TestRunner::pathToLocalResource(const QString& url)
     return url;
 }
 
-void TestRunner::dumpEditingCallbacks()
+void TestRunnerQt::dumpEditingCallbacks()
 {
     qDebug() << ">>>dumpEditingCallbacks";
     DumpRenderTreeSupportQt::dumpEditingCallbacks(true);
 }
 
-void TestRunner::dumpFrameLoadCallbacks()
+void TestRunnerQt::dumpFrameLoadCallbacks()
 {
     DumpRenderTreeSupportQt::dumpFrameLoader(true);
 }
 
-void TestRunner::dumpProgressFinishedCallback()
+void TestRunnerQt::dumpProgressFinishedCallback()
 {
     DumpRenderTreeSupportQt::dumpProgressFinishedCallback(true);
 }
 
-void TestRunner::dumpUserGestureInFrameLoadCallbacks()
+void TestRunnerQt::dumpUserGestureInFrameLoadCallbacks()
 {
     DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true);
 }
 
-void TestRunner::dumpResourceLoadCallbacks()
+void TestRunnerQt::dumpResourceLoadCallbacks()
 {
     DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(true);
 }
 
-void TestRunner::dumpResourceResponseMIMETypes()
+void TestRunnerQt::dumpResourceResponseMIMETypes()
 {
     DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true);
 }
 
-void TestRunner::dumpWillCacheResponse()
+void TestRunnerQt::dumpWillCacheResponse()
 {
     DumpRenderTreeSupportQt::dumpWillCacheResponseCallbacks(true);
 }
 
-void TestRunner::dumpHistoryCallbacks()
+void TestRunnerQt::dumpHistoryCallbacks()
 {
     DumpRenderTreeSupportQt::dumpHistoryCallbacks(true);
 }
 
-void TestRunner::setWillSendRequestReturnsNullOnRedirect(bool enabled)
+void TestRunnerQt::setWillSendRequestReturnsNullOnRedirect(bool enabled)
 {
     DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled);
 }
 
-void TestRunner::setWillSendRequestReturnsNull(bool enabled)
+void TestRunnerQt::setWillSendRequestReturnsNull(bool enabled)
 {
     DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(enabled);
 }
 
-void TestRunner::setWillSendRequestClearHeader(const QStringList& headers)
+void TestRunnerQt::setWillSendRequestClearHeader(const QStringList& headers)
 {
     DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers);
 }
 
-void TestRunner::setDeferMainResourceDataLoad(bool defer)
+void TestRunnerQt::setDeferMainResourceDataLoad(bool defer)
 {
     DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(defer);
 }
 
-void TestRunner::queueBackNavigation(int howFarBackward)
+void TestRunnerQt::queueBackNavigation(int howFarBackward)
 {
     //qDebug() << ">>>queueBackNavigation" << howFarBackward;
     for (int i = 0; i != howFarBackward; ++i)
         WorkQueue::shared()->queue(new BackItem(1, m_drt->webPage()));
 }
 
-void TestRunner::queueForwardNavigation(int howFarForward)
+void TestRunnerQt::queueForwardNavigation(int howFarForward)
 {
     //qDebug() << ">>>queueForwardNavigation" << howFarForward;
     for (int i = 0; i != howFarForward; ++i)
         WorkQueue::shared()->queue(new ForwardItem(1, m_drt->webPage()));
 }
 
-void TestRunner::queueLoad(const QString& url, const QString& target)
+void TestRunnerQt::queueLoad(const QString& url, const QString& target)
 {
     //qDebug() << ">>>queueLoad" << url << target;
     QUrl mainResourceUrl = m_drt->webPage()->mainFrame()->url();
@@ -365,7 +365,7 @@ void TestRunner::queueLoad(const QString& url, const QString& target)
     WorkQueue::shared()->queue(new LoadItem(absoluteUrl, target, m_drt->webPage()));
 }
 
-void TestRunner::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL)
+void TestRunnerQt::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL)
 {
     if (failingURL.isEmpty())
         WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, m_drt->webPage()));
@@ -373,32 +373,32 @@ void TestRunner::queueLoadHTMLString(const QString& content, const QString& base
         WorkQueue::shared()->queue(new LoadAlternateHTMLStringItem(content, baseURL, failingURL, m_drt->webPage()));
 }
 
-void TestRunner::queueReload()
+void TestRunnerQt::queueReload()
 {
     //qDebug() << ">>>queueReload";
     WorkQueue::shared()->queue(new ReloadItem(m_drt->webPage()));
 }
 
-void TestRunner::queueLoadingScript(const QString& script)
+void TestRunnerQt::queueLoadingScript(const QString& script)
 {
     //qDebug() << ">>>queueLoadingScript" << script;
     WorkQueue::shared()->queue(new LoadingScriptItem(script, m_drt->webPage()));
 }
 
-void TestRunner::queueNonLoadingScript(const QString& script)
+void TestRunnerQt::queueNonLoadingScript(const QString& script)
 {
     //qDebug() << ">>>queueNonLoadingScript" << script;
     WorkQueue::shared()->queue(new NonLoadingScriptItem(script, m_drt->webPage()));
 }
 
-void TestRunner::provisionalLoad()
+void TestRunnerQt::provisionalLoad()
 {
     QWebFrame* frame = qobject_cast<QWebFrame*>(sender());
     if (!m_topLoadingFrame && !m_hasDumped)
         m_topLoadingFrame = frame;
 }
 
-void TestRunner::timerEvent(QTimerEvent *ev)
+void TestRunnerQt::timerEvent(QTimerEvent *ev)
 {
     if (ev->timerId() == m_timeoutTimer.timerId()) {
         const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
@@ -409,129 +409,129 @@ void TestRunner::timerEvent(QTimerEvent *ev)
         QObject::timerEvent(ev);
 }
 
-QString TestRunner::encodeHostName(const QString& host)
+QString TestRunnerQt::encodeHostName(const QString& host)
 {
     QString encoded = QString::fromLatin1(QUrl::toAce(host + QLatin1String(".no")));
     encoded.truncate(encoded.length() - 3); // strip .no
     return encoded;
 }
 
-QString TestRunner::decodeHostName(const QString& host)
+QString TestRunnerQt::decodeHostName(const QString& host)
 {
     QString decoded = QUrl::fromAce(host.toLatin1() + QByteArray(".no"));
     decoded.truncate(decoded.length() - 3);
     return decoded;
 }
 
-void TestRunner::closeWebInspector()
+void TestRunnerQt::closeWebInspector()
 {
     DumpRenderTreeSupportQt::webInspectorClose(m_drt->pageAdapter());
     m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
 }
 
-void TestRunner::setDeveloperExtrasEnabled(bool enabled)
+void TestRunnerQt::setDeveloperExtrasEnabled(bool enabled)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enabled);
 }
 
-void TestRunner::setAsynchronousSpellCheckingEnabled(bool)
+void TestRunnerQt::setAsynchronousSpellCheckingEnabled(bool)
 {
     // FIXME: Implement this.
 }
 
-void TestRunner::showWebInspector()
+void TestRunnerQt::showWebInspector()
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
     DumpRenderTreeSupportQt::webInspectorShow(m_drt->pageAdapter());
 }
 
-void TestRunner::evaluateInWebInspector(long callId, const QString& script)
+void TestRunnerQt::evaluateInWebInspector(long callId, const QString& script)
 {
     DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->pageAdapter(), callId, script);
 }
 
-void TestRunner::goBack()
+void TestRunnerQt::goBack()
 {
     DumpRenderTreeSupportQt::goBack(m_drt->pageAdapter());
 }
 
-void TestRunner::setDefersLoading(bool flag)
+void TestRunnerQt::setDefersLoading(bool flag)
 {
     DumpRenderTreeSupportQt::setDefersLoading(m_drt->pageAdapter(), flag);
 }
 
-void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled)
+void TestRunnerQt::setAllowUniversalAccessFromFileURLs(bool enabled)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, enabled);
 }
 
-void TestRunner::setAllowFileAccessFromFileURLs(bool enabled)
+void TestRunnerQt::setAllowFileAccessFromFileURLs(bool enabled)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, enabled);
 }
 
-void TestRunner::setAppCacheMaximumSize(unsigned long long quota)
+void TestRunnerQt::setAppCacheMaximumSize(unsigned long long quota)
 {
     m_drt->webPage()->settings()->setOfflineWebApplicationCacheQuota(quota);
 }
 
-void TestRunner::setAutofilled(const QWebElement& element, bool isAutofilled)
+void TestRunnerQt::setAutofilled(const QWebElement& element, bool isAutofilled)
 {
     return DumpRenderTreeSupportQt::setAutofilled(element, isAutofilled);
 }
 
-void TestRunner::setValueForUser(const QWebElement& element, const QString& value)
+void TestRunnerQt::setValueForUser(const QWebElement& element, const QString& value)
 {
     DumpRenderTreeSupportQt::setValueForUser(element, value);
 }
 
-void TestRunner::setFixedContentsSize(int width, int height)
+void TestRunnerQt::setFixedContentsSize(int width, int height)
 {
     m_topLoadingFrame->page()->setPreferredContentsSize(QSize(width, height));
 }
 
-void TestRunner::setPrivateBrowsingEnabled(bool enable)
+void TestRunnerQt::setPrivateBrowsingEnabled(bool enable)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, enable);
 }
 
-void TestRunner::setSpatialNavigationEnabled(bool enable)
+void TestRunnerQt::setSpatialNavigationEnabled(bool enable)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, enable);
 }
 
-void TestRunner::setPopupBlockingEnabled(bool enable)
+void TestRunnerQt::setPopupBlockingEnabled(bool enable)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, !enable);
 }
 
-void TestRunner::setPluginsEnabled(bool flag)
+void TestRunnerQt::setPluginsEnabled(bool flag)
 {
     // FIXME: Implement
 }
 
-void TestRunner::setPOSIXLocale(const QString& locale)
+void TestRunnerQt::setPOSIXLocale(const QString& locale)
 {
     QLocale qlocale(locale);
     QLocale::setDefault(qlocale);
 } 
 
-void TestRunner::setWindowIsKey(bool isKey)
+void TestRunnerQt::setWindowIsKey(bool isKey)
 {
     m_drt->switchFocus(isKey);
 }
 
-void TestRunner::setMainFrameIsFirstResponder(bool isFirst)
+void TestRunnerQt::setMainFrameIsFirstResponder(bool isFirst)
 {
     //FIXME: only need this for the moment: https://bugs.webkit.org/show_bug.cgi?id=32990
 }
 
-void TestRunner::setJavaScriptCanAccessClipboard(bool enable)
+void TestRunnerQt::setJavaScriptCanAccessClipboard(bool enable)
 {
     m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, enable);
 }
 
-void TestRunner::setXSSAuditorEnabled(bool enable)
+void TestRunnerQt::setXSSAuditorEnabled(bool enable)
 {
     // Set XSSAuditingEnabled globally so that windows created by the test inherit it too.
     // resetSettings() will call this to reset the page and global setting to false again.
@@ -541,47 +541,47 @@ void TestRunner::setXSSAuditorEnabled(bool enable)
     m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditingEnabled, enable);
 }
 
-void TestRunner::dispatchPendingLoadRequests()
+void TestRunnerQt::dispatchPendingLoadRequests()
 {
     // FIXME: Implement for testing fix for 6727495
 }
 
-void TestRunner::clearAllApplicationCaches()
+void TestRunnerQt::clearAllApplicationCaches()
 {
     DumpRenderTreeSupportQt::clearAllApplicationCaches();
 }
 
-void TestRunner::clearApplicationCacheForOrigin(const QString& url)
+void TestRunnerQt::clearApplicationCacheForOrigin(const QString& url)
 {
     // FIXME: Implement to support deleting all application caches for an origin.
 }
 
-long long TestRunner::localStorageDiskUsageForOrigin(const QString& originIdentifier)
+long long TestRunnerQt::localStorageDiskUsageForOrigin(const QString& originIdentifier)
 {
     // FIXME: Implement to support getting disk usage in bytes for an origin.
     return 0;
 }
 
-void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota)
+void TestRunnerQt::setApplicationCacheOriginQuota(unsigned long long quota)
 {
     if (!m_topLoadingFrame)
         return;
     m_topLoadingFrame->securityOrigin().setApplicationCacheQuota(quota);
 }
 
-long long TestRunner::applicationCacheDiskUsageForOrigin(const QString& origin)
+long long TestRunnerQt::applicationCacheDiskUsageForOrigin(const QString& origin)
 {
     // FIXME: Implement to support getting disk usage by all application caches for an origin.
     return 0;
 }
 
-QStringList TestRunner::originsWithApplicationCache()
+QStringList TestRunnerQt::originsWithApplicationCache()
 {
     // FIXME: Implement to get origins that have application caches.
     return QStringList();
 }
 
-void TestRunner::setCacheModel(int model)
+void TestRunnerQt::setCacheModel(int model)
 {
     // qwebsetting doesn't have matched setting yet :
     // WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER
@@ -591,41 +591,41 @@ void TestRunner::setCacheModel(int model)
     // FIXME: Implement.
 }
 
-void TestRunner::setDatabaseQuota(int size)
+void TestRunnerQt::setDatabaseQuota(int size)
 {
     if (!m_topLoadingFrame)
         return;
     m_topLoadingFrame->securityOrigin().setDatabaseQuota(size);
 }
 
-void TestRunner::clearAllDatabases()
+void TestRunnerQt::clearAllDatabases()
 {
     QWebDatabase::removeAllDatabases();
 }
 
-void TestRunner::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void TestRunnerQt::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
 {
     DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
 }
 
-void TestRunner::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void TestRunnerQt::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
 {
     DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
 }
 
-void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive)
+void TestRunnerQt::setCustomPolicyDelegate(bool enabled, bool permissive)
 {
     DumpRenderTreeSupportQt::setCustomPolicyDelegate(enabled, permissive);
 }
 
-void TestRunner::waitForPolicyDelegate()
+void TestRunnerQt::waitForPolicyDelegate()
 {
     setCustomPolicyDelegate(true);
     m_waitForPolicy = true;
     waitUntilDone();
 }
 
-void TestRunner::overridePreference(const QString& name, const QVariant& value)
+void TestRunnerQt::overridePreference(const QString& name, const QVariant& value)
 {
     QWebSettings* settings = m_topLoadingFrame->page()->settings();
 
@@ -662,7 +662,7 @@ void TestRunner::overridePreference(const QString& name, const QVariant& value)
             name.toLatin1().data());
 }
 
-void TestRunner::setUserStyleSheetLocation(const QString& url)
+void TestRunnerQt::setUserStyleSheetLocation(const QString& url)
 {
     QByteArray urlData = pathToLocalResource(url).toLatin1();
     m_userStyleSheetLocation = QUrl::fromEncoded(urlData, QUrl::StrictMode);
@@ -671,17 +671,17 @@ void TestRunner::setUserStyleSheetLocation(const QString& url)
         setUserStyleSheetEnabled(true);
 }
 
-void TestRunner::setCaretBrowsingEnabled(bool value)
+void TestRunnerQt::setCaretBrowsingEnabled(bool value)
 {
     DumpRenderTreeSupportQt::setCaretBrowsingEnabled(m_drt->pageAdapter(), value);
 }
 
-void TestRunner::setAuthorAndUserStylesEnabled(bool value)
+void TestRunnerQt::setAuthorAndUserStylesEnabled(bool value)
 {
     DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(m_drt->pageAdapter(), value);
 }
 
-void TestRunner::setUserStyleSheetEnabled(bool enabled)
+void TestRunnerQt::setUserStyleSheetEnabled(bool enabled)
 {
     m_userStyleSheetEnabled = enabled;
 
@@ -691,17 +691,17 @@ void TestRunner::setUserStyleSheetEnabled(bool enabled)
         m_drt->webPage()->settings()->setUserStyleSheetUrl(QUrl());
 }
 
-void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
+void TestRunnerQt::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
 {
     DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
 }
 
-bool TestRunner::callShouldCloseOnWebView()
+bool TestRunnerQt::callShouldCloseOnWebView()
 {
     return DumpRenderTreeSupportQt::shouldClose(m_drt->mainFrameAdapter());
 }
 
-void TestRunner::setScrollbarPolicy(const QString& orientation, const QString& policy)
+void TestRunnerQt::setScrollbarPolicy(const QString& orientation, const QString& policy)
 {
     Qt::Orientation o;
     Qt::ScrollBarPolicy p;
@@ -725,52 +725,52 @@ void TestRunner::setScrollbarPolicy(const QString& orientation, const QString& p
     m_drt->webPage()->mainFrame()->setScrollBarPolicy(o, p);
 }
 
-void TestRunner::setSmartInsertDeleteEnabled(bool enable)
+void TestRunnerQt::setSmartInsertDeleteEnabled(bool enable)
 {
     DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(m_drt->pageAdapter(), enable);
 }
 
-void TestRunner::setSelectTrailingWhitespaceEnabled(bool enable)
+void TestRunnerQt::setSelectTrailingWhitespaceEnabled(bool enable)
 {
     DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(m_drt->pageAdapter(), enable);
 }
 
-void TestRunner::execCommand(const QString& name, const QString& value)
+void TestRunnerQt::execCommand(const QString& name, const QString& value)
 {
     DumpRenderTreeSupportQt::executeCoreCommandByName(m_drt->pageAdapter(), name, value);
 }
 
-bool TestRunner::isCommandEnabled(const QString& name) const
+bool TestRunnerQt::isCommandEnabled(const QString& name) const
 {
     return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->pageAdapter(), name);
 }
 
-bool TestRunner::findString(const QString& string, const QStringList& optionArray)
+bool TestRunnerQt::findString(const QString& string, const QStringList& optionArray)
 {
     return DumpRenderTreeSupportQt::findString(m_drt->pageAdapter(), string, optionArray);
 }
 
-QString TestRunner::markerTextForListItem(const QWebElement& listItem)
+QString TestRunnerQt::markerTextForListItem(const QWebElement& listItem)
 {
     return DumpRenderTreeSupportQt::markerTextForListItem(listItem);
 }
 
-QVariantMap TestRunner::computedStyleIncludingVisitedInfo(const QWebElement& element) const
+QVariantMap TestRunnerQt::computedStyleIncludingVisitedInfo(const QWebElement& element) const
 {
     return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(element);
 }
 
-bool TestRunner::elementDoesAutoCompleteForElementWithId(const QString& elementId)
+bool TestRunnerQt::elementDoesAutoCompleteForElementWithId(const QString& elementId)
 {
     return DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(m_drt->mainFrameAdapter(), elementId);
 }
 
-void TestRunner::authenticateSession(const QString&, const QString&, const QString&)
+void TestRunnerQt::authenticateSession(const QString&, const QString&, const QString&)
 {
     // FIXME: If there is a concept per-session (per-process) credential storage, the credentials should be added to it for later use.
 }
 
-void TestRunner::setIconDatabaseEnabled(bool enable)
+void TestRunnerQt::setIconDatabaseEnabled(bool enable)
 {
     if (enable && !m_drt->persistentStoragePath().isEmpty())
         QWebSettings::setIconDatabasePath(m_drt->persistentStoragePath());
@@ -778,14 +778,14 @@ void TestRunner::setIconDatabaseEnabled(bool enable)
         QWebSettings::setIconDatabasePath(QString());
 }
 
-void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+void TestRunnerQt::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
 {
     QList<WebCore::WebPage*> pages = m_drt->getAllPages();
     foreach (WebCore::WebPage* page, pages)
         DumpRenderTreeSupportQt::setMockDeviceOrientation(page->handle(), canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
 }
 
-void TestRunner::setGeolocationPermission(bool allow)
+void TestRunnerQt::setGeolocationPermission(bool allow)
 {
     setGeolocationPermissionCommon(allow);
     QList<WebCore::WebPage*> pages = m_drt->getAllPages();
@@ -793,7 +793,7 @@ void TestRunner::setGeolocationPermission(bool allow)
         DumpRenderTreeSupportQt::setMockGeolocationPermission(page->handle(), allow);
 }
 
-int TestRunner::numberOfPendingGeolocationPermissionRequests()
+int TestRunnerQt::numberOfPendingGeolocationPermissionRequests()
 {
     int pendingPermissionCount = 0;
     QList<WebCore::WebPage*> pages = m_drt->getAllPages();
@@ -803,112 +803,112 @@ int TestRunner::numberOfPendingGeolocationPermissionRequests()
     return pendingPermissionCount;
 }
 
-void TestRunner::setGeolocationPermissionCommon(bool allow)
+void TestRunnerQt::setGeolocationPermissionCommon(bool allow)
 {
      m_isGeolocationPermissionSet = true;
      m_geolocationPermission = allow;
 }
 
-void TestRunner::setMockGeolocationPositionUnavailableError(const QString& message)
+void TestRunnerQt::setMockGeolocationPositionUnavailableError(const QString& message)
 {
     QList<WebCore::WebPage*> pages = m_drt->getAllPages();
     foreach (WebCore::WebPage* page, pages)
         DumpRenderTreeSupportQt::setMockGeolocationPositionUnavailableError(page->handle(), message);
 }
 
-void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+void TestRunnerQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
 {
     QList<WebCore::WebPage*> pages = m_drt->getAllPages();
     foreach (WebCore::WebPage* page, pages)
         DumpRenderTreeSupportQt::setMockGeolocationPosition(page->handle(), latitude, longitude, accuracy);
 }
 
-void TestRunner::addMockSpeechInputResult(const QString& result, double confidence, const QString& language)
+void TestRunnerQt::addMockSpeechInputResult(const QString& result, double confidence, const QString& language)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
 }
 
-void TestRunner::setMockSpeechInputDumpRect(bool flag)
+void TestRunnerQt::setMockSpeechInputDumpRect(bool flag)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
 }
 
-void TestRunner::startSpeechInput(const QString& inputElement)
+void TestRunnerQt::startSpeechInput(const QString& inputElement)
 {
     // FIXME: Implement for speech input layout tests.
     // See https://bugs.webkit.org/show_bug.cgi?id=39485.
 }
 
-void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script)
+void TestRunnerQt::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script)
 {
     // FIXME: Implement.
 }
 
-void TestRunner::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
+void TestRunnerQt::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
 {
     DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->mainFrameAdapter(), worldID, script);
 }
 
-void TestRunner::addUserStyleSheet(const QString& sourceCode)
+void TestRunnerQt::addUserStyleSheet(const QString& sourceCode)
 {
     DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->pageAdapter(), sourceCode);
 }
 
-void TestRunner::removeAllVisitedLinks()
+void TestRunnerQt::removeAllVisitedLinks()
 {
     QWebHistory* history = m_drt->webPage()->history();
     history->clear();
     DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true);
 }
 
-void TestRunner::addURLToRedirect(const QString& origin, const QString& destination)
+void TestRunnerQt::addURLToRedirect(const QString& origin, const QString& destination)
 {
     DumpRenderTreeSupportQt::addURLToRedirect(origin, destination);
 }
 
-void TestRunner::originsWithLocalStorage()
+void TestRunnerQt::originsWithLocalStorage()
 {
     // FIXME: Implement.
 }
 
-void TestRunner::deleteAllLocalStorage()
+void TestRunnerQt::deleteAllLocalStorage()
 {
     // FIXME: Implement.
 }
 
-void TestRunner::deleteLocalStorageForOrigin(const QString& originIdentifier)
+void TestRunnerQt::deleteLocalStorageForOrigin(const QString& originIdentifier)
 {
     // FIXME: Implement.
 }
 
-void TestRunner::observeStorageTrackerNotifications(unsigned number)
+void TestRunnerQt::observeStorageTrackerNotifications(unsigned number)
 {
     // FIXME: Implement.
 }
 
-void TestRunner::syncLocalStorage()
+void TestRunnerQt::syncLocalStorage()
 {
     // FIXME: Implement.
 }
 
-void TestRunner::resetPageVisibility()
+void TestRunnerQt::resetPageVisibility()
 {
     // FIXME: Implement this.
 }
 
-void TestRunner::setPageVisibility(const char*)
+void TestRunnerQt::setPageVisibility(const char*)
 {
     // FIXME: Implement this.
 }
 
-void TestRunner::setAutomaticLinkDetectionEnabled(bool)
+void TestRunnerQt::setAutomaticLinkDetectionEnabled(bool)
 {
     // FIXME: Implement this.
 }
 
-void TestRunner::setTextDirection(const QString& directionName)
+void TestRunnerQt::setTextDirection(const QString& directionName)
 {
     if (directionName == "auto")
         m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionDefault);
@@ -918,7 +918,7 @@ void TestRunner::setTextDirection(const QString& directionName)
         m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionLeftToRight);
 }
 
-void TestRunner::setAlwaysAcceptCookies(bool accept)
+void TestRunnerQt::setAlwaysAcceptCookies(bool accept)
 {
     QWebSettings* globalSettings = QWebSettings::globalSettings();
     if (accept)
@@ -929,7 +929,7 @@ void TestRunner::setAlwaysAcceptCookies(bool accept)
     }
 }
 
-void TestRunner::setAlwaysBlockCookies(bool block)
+void TestRunnerQt::setAlwaysBlockCookies(bool block)
 {
     QWebSettings* globalSettings = QWebSettings::globalSettings();
     if (block)
@@ -938,11 +938,11 @@ void TestRunner::setAlwaysBlockCookies(bool block)
         globalSettings->setThirdPartyCookiePolicy(QWebSettings::AlwaysAllowThirdPartyCookies);
 }
 
-void TestRunner::setAudioData(const QByteArray& audioData)
+void TestRunnerQt::setAudioData(const QByteArray& audioData)
 {
     m_audioData = audioData;
     m_audioDump = true;
 }
 
-const unsigned TestRunner::maxViewWidth = 800;
-const unsigned TestRunner::maxViewHeight = 600;
+const unsigned TestRunnerQt::maxViewWidth = 800;
+const unsigned TestRunnerQt::maxViewHeight = 600;
index e6f83e1a655596c53c29149e40a48cd68e4c676d..bc2af9a143312ffb7260585c450327fcb5e129fd 100644 (file)
@@ -53,12 +53,12 @@ namespace WebCore {
 class DumpRenderTree;
 }
 
-class TestRunner : public QObject {
+class TestRunnerQt : public QObject {
     Q_OBJECT
     Q_PROPERTY(int webHistoryItemCount READ webHistoryItemCount)
     Q_PROPERTY(bool globalFlag READ globalFlag WRITE setGlobalFlag)
 public:
-    TestRunner(WebCore::DumpRenderTree*);
+    TestRunnerQt(WebCore::DumpRenderTree*);
 
     bool shouldDisallowIncreaseForApplicationCacheQuota() const { return m_disallowIncreaseForApplicationCacheQuota; }
     bool shouldDumpAsText() const { return m_textDump; }