diff options
author | Steve Block <steveblock@google.com> | 2011-05-18 13:36:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 15:38:28 +0100 |
commit | 2fc2651226baac27029e38c9d6ef883fa32084db (patch) | |
tree | e396d4bf89dcce6ed02071be66212495b1df1dec /Tools/DumpRenderTree/qt | |
parent | b3725cedeb43722b3b175aaeff70552e562d2c94 (diff) | |
download | external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2 |
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Tools/DumpRenderTree/qt')
-rw-r--r-- | Tools/DumpRenderTree/qt/DumpRenderTree.pro | 4 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp | 40 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/DumpRenderTreeQt.h | 2 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/EventSenderQt.cpp | 3 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/EventSenderQt.h | 2 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/ImageDiff.pro | 2 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp | 6 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/LayoutTestControllerQt.h | 2 | ||||
-rw-r--r-- | Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro | 2 |
9 files changed, 37 insertions, 26 deletions
diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index a7c6c26..d84af96 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -5,12 +5,12 @@ CONFIG += uitools BASEDIR = $$PWD/../ isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../.. -include(../../../WebKit.pri) +include(../../../Source/WebKit.pri) INCLUDEPATH += ../../../Source INCLUDEPATH += ../../../Source/JavaScriptCore INCLUDEPATH += ../../../Source/JavaScriptCore/ForwardingHeaders INCLUDEPATH += $$BASEDIR -DESTDIR = ../../../bin +DESTDIR = ../../bin unix:!mac:!symbian { CONFIG += link_pkgconfig diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index ce608cc..7d20f47 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -83,6 +83,8 @@ namespace WebCore { +const int databaseDefaultQuota = 5 * 1024 * 1024; + NetworkAccessManager::NetworkAccessManager(QObject* parent) : QNetworkAccessManager(parent) { @@ -520,7 +522,7 @@ void DumpRenderTree::dryRunPrint(QWebFrame* frame) #endif } -void DumpRenderTree::resetToConsistentStateBeforeTesting() +void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) { // reset so that any current loads are stopped // NOTE: that this has to be done before the layoutTestController is @@ -529,6 +531,10 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting() m_page->triggerAction(QWebPage::Stop); m_page->blockSignals(false); + QList<QWebSecurityOrigin> knownOrigins = QWebSecurityOrigin::allOrigins(); + for (int i = 0; i < knownOrigins.size(); ++i) + knownOrigins[i].setDatabaseQuota(databaseDefaultQuota); + // reset the layoutTestController at this point, so that we under no // circumstance dump (stop the waitUntilDone timer) during the reset // of the DRT. @@ -550,6 +556,14 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting() m_page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded); m_page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded); + if (url.scheme() == "http" || url.scheme() == "https") { + // credentials may exist from previous tests. + m_page->setNetworkAccessManager(0); + delete m_networkAccessManager; + m_networkAccessManager = new NetworkAccessManager(this); + m_page->setNetworkAccessManager(m_networkAccessManager); + } + WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); @@ -560,6 +574,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting() QLocale::setDefault(QLocale::c()); + layoutTestController()->setDeveloperExtrasEnabled(true); #ifndef Q_OS_WINCE setlocale(LC_ALL, ""); #endif @@ -579,26 +594,16 @@ static bool isWebInspectorTest(const QUrl& url) return false; } -static bool shouldEnableDeveloperExtras(const QUrl& url) -{ - return true; -} - void DumpRenderTree::open(const QUrl& url) { DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(QFileInfo(url.toString()).path()); - resetToConsistentStateBeforeTesting(); + resetToConsistentStateBeforeTesting(url); - if (shouldEnableDeveloperExtras(m_page->mainFrame()->url())) { + if (isWebInspectorTest(m_page->mainFrame()->url())) layoutTestController()->closeWebInspector(); - layoutTestController()->setDeveloperExtrasEnabled(false); - } - if (shouldEnableDeveloperExtras(url)) { - layoutTestController()->setDeveloperExtrasEnabled(true); - if (isWebInspectorTest(url)) - layoutTestController()->showWebInspector(); - } + if (isWebInspectorTest(url)) + layoutTestController()->showWebInspector(); if (isGlobalHistoryTest(url)) layoutTestController()->dumpHistoryCallbacks(); @@ -1028,7 +1033,7 @@ void DumpRenderTree::dumpDatabaseQuota(QWebFrame* frame, const QString& dbName) origin.host().toUtf8().data(), origin.port(), dbName.toUtf8().data()); - origin.setDatabaseQuota(5 * 1024 * 1024); + origin.setDatabaseQuota(databaseDefaultQuota); } void DumpRenderTree::dumpApplicationCacheQuota(QWebSecurityOrigin* origin, quint64 defaultOriginQuota) @@ -1085,9 +1090,6 @@ void DumpRenderTree::windowCloseRequested() QWebPage* page = qobject_cast<QWebPage*>(sender()); QObject* container = page->parent(); windows.removeAll(container); - // Our use of container->deleteLater() means we need to remove closed pages - // from the org.webkit.qt.DumpRenderTree group explicitly. - DumpRenderTreeSupportQt::webPageSetGroupName(page, ""); container->deleteLater(); } diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h index 8cb5efb..5b53cd9 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h @@ -86,7 +86,7 @@ public: void setDumpPixels(bool); void closeRemainingWindows(); - void resetToConsistentStateBeforeTesting(); + void resetToConsistentStateBeforeTesting(const QUrl&); LayoutTestController *layoutTestController() const { return m_controller; } EventSender *eventSender() const { return m_eventSender; } diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.cpp b/Tools/DumpRenderTree/qt/EventSenderQt.cpp index 6fb75a5..6449484 100644 --- a/Tools/DumpRenderTree/qt/EventSenderQt.cpp +++ b/Tools/DumpRenderTree/qt/EventSenderQt.cpp @@ -360,7 +360,7 @@ void EventSender::keyDown(const QString& string, const QStringList& modifiers, u sendEvent(m_page, &event2); } -void EventSender::contextClick() +QStringList EventSender::contextClick() { QMouseEvent event(QEvent::MouseButtonPress, m_mousePos, Qt::RightButton, Qt::RightButton, Qt::NoModifier); sendEvent(m_page, &event); @@ -378,6 +378,7 @@ void EventSender::contextClick() QContextMenuEvent ctxEvent(QContextMenuEvent::Mouse, m_mousePos); sendEvent(m_page->view(), &ctxEvent); } + return DumpRenderTreeSupportQt::contextMenu(m_page); } void EventSender::scheduleAsynchronousClick() diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h index 4ba8382..ecb06e2 100644 --- a/Tools/DumpRenderTree/qt/EventSenderQt.h +++ b/Tools/DumpRenderTree/qt/EventSenderQt.h @@ -65,7 +65,7 @@ public slots: void leapForward(int ms); void keyDown(const QString& string, const QStringList& modifiers = QStringList(), unsigned int location = 0); void clearKillRing() {} - void contextClick(); + QStringList contextClick(); void scheduleAsynchronousClick(); void addTouchPoint(int x, int y); void updateTouchPoint(int index, int x, int y); diff --git a/Tools/DumpRenderTree/qt/ImageDiff.pro b/Tools/DumpRenderTree/qt/ImageDiff.pro index a218449..cdb067e 100644 --- a/Tools/DumpRenderTree/qt/ImageDiff.pro +++ b/Tools/DumpRenderTree/qt/ImageDiff.pro @@ -2,7 +2,7 @@ TARGET = ImageDiff CONFIG -= app_bundle isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../.. -include(../../../WebKit.pri) +include(../../../Source/WebKit.pri) INCLUDEPATH += ../../../Source/JavaScriptCore DESTDIR = $$OUTPUT_DIR/bin diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index 56406c2..a11bc60 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -87,6 +87,7 @@ void LayoutTestController::reset() DumpRenderTreeSupportQt::dumpHistoryCallbacks(false); DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false); setIconDatabaseEnabled(false); + clearAllDatabases(); emit hidePage(); } @@ -830,5 +831,10 @@ QVariantList LayoutTestController::nodesFromRect(const QWebElement& document, in return DumpRenderTreeSupportQt::nodesFromRect(document, x, y, top, right, bottom, left, ignoreClipping); } +void LayoutTestController::addURLToRedirect(const QString& origin, const QString& destination) +{ + DumpRenderTreeSupportQt::addURLToRedirect(origin, destination); +} + const unsigned LayoutTestController::maxViewWidth = 800; const unsigned LayoutTestController::maxViewHeight = 600; diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h index 0048a7e..bc62c51 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -230,6 +230,8 @@ public slots: QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping); + void addURLToRedirect(const QString& origin, const QString& destination); + /* Policy values: 'on', 'auto' or 'off'. Orientation values: 'vertical' or 'horizontal'. diff --git a/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro index 6f96d0a..176c4c4 100644 --- a/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro +++ b/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro @@ -3,7 +3,7 @@ TARGET = TestNetscapePlugIn VPATH = ../../unix/TestNetscapePlugin ../../TestNetscapePlugIn isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. -include(../../../../WebKit.pri) +include(../../../../Source/WebKit.pri) DESTDIR = $$OUTPUT_DIR/lib/plugins |