diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Tools/DumpRenderTree | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Tools/DumpRenderTree')
35 files changed, 323 insertions, 204 deletions
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/.gitignore b/Tools/DumpRenderTree/DumpRenderTree.gyp/.gitignore index 72f70a29c..2ca14bf1e 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gyp/.gitignore +++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/.gitignore @@ -2,4 +2,5 @@ *.mk *.sln *.vcproj* +*.vcxproj* *.xcodeproj* diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi index 5412a199e..a414fd25a 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gypi +++ b/Tools/DumpRenderTree/DumpRenderTree.gypi @@ -80,6 +80,7 @@ 'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURL.cpp', 'TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp', 'TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp', + 'TestNetscapePlugIn/Tests/LeakWindowScriptableObject.cpp', 'TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp', 'TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp', 'TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp', diff --git a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj index 1b96e077e..7249a09bc 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj +++ b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj @@ -174,6 +174,13 @@ remoteGlobalIDString = 2D403EB2150871F9005358D2; remoteInfo = LayoutTestHelper; }; + 378C802315AB589B00746821 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9340994A08540CAE007F3BC8; + remoteInfo = DumpRenderTree; + }; 5DC82A6F1023C93D00FD1D3B /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */; @@ -739,6 +746,7 @@ buildToolPath = make; buildWorkingDirectory = "$(SRCROOT)/mac/PerlSupport"; dependencies = ( + 378C802415AB589B00746821 /* PBXTargetDependency */, ); name = "DumpRenderTree Perl Support"; passBuildSettingsInEnvironment = 1; @@ -967,6 +975,11 @@ target = 2D403EB2150871F9005358D2 /* LayoutTestHelper */; targetProxy = 2D403F201508736C005358D2 /* PBXContainerItemProxy */; }; + 378C802415AB589B00746821 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9340994A08540CAE007F3BC8 /* DumpRenderTree */; + targetProxy = 378C802315AB589B00746821 /* PBXContainerItemProxy */; + }; 5DC82A701023C93D00FD1D3B /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 5DC82A661023C8DE00FD1D3B /* DumpRenderTree Perl Support */; diff --git a/Tools/DumpRenderTree/LayoutTestController.cpp b/Tools/DumpRenderTree/LayoutTestController.cpp index cd01d1c3b..3548c8b77 100644 --- a/Tools/DumpRenderTree/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/LayoutTestController.cpp @@ -160,29 +160,6 @@ static JSValueRef dumpChildFrameScrollPositionsCallback(JSContextRef context, JS return JSValueMakeUndefined(context); } -static JSValueRef dumpConfigurationForViewportCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - if (argumentCount < 2) - return JSValueMakeUndefined(context); - - - double deviceDPI = JSValueToNumber(context, arguments[0], exception); - ASSERT(!*exception); - double deviceWidth = JSValueToNumber(context, arguments[1], exception); - ASSERT(!*exception); - double deviceHeight = JSValueToNumber(context, arguments[2], exception); - ASSERT(!*exception); - double availableWidth = JSValueToNumber(context, arguments[3], exception); - ASSERT(!*exception); - double availableHeight = JSValueToNumber(context, arguments[4], exception); - ASSERT(!*exception); - - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); - controller->dumpConfigurationForViewport(static_cast<int>(deviceDPI), static_cast<int>(deviceWidth), static_cast<int>(deviceHeight), static_cast<int>(availableWidth), static_cast<int>(availableHeight)); - - return JSValueMakeUndefined(context); -} - static JSValueRef dumpDatabaseCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); @@ -2225,6 +2202,20 @@ static JSValueRef setHasCustomFullScreenBehaviorCallback(JSContextRef context, J return JSValueMakeUndefined(context); } +static JSValueRef setStorageDatabaseIdleIntervalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + if (argumentCount != 1) + return JSValueMakeUndefined(context); + + double interval = JSValueToNumber(context, arguments[0], exception); + ASSERT(!*exception); + + LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + controller->setStorageDatabaseIdleInterval(interval); + + return JSValueMakeUndefined(context); +} + static void layoutTestControllerObjectFinalize(JSObjectRef object) { LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(object)); @@ -2306,7 +2297,6 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "dumpBackForwardList", dumpBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpChildFrameScrollPositions", dumpChildFrameScrollPositionsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpChildFramesAsText", dumpChildFramesAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "dumpConfigurationForViewport", dumpConfigurationForViewportCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpDOMAsWebArchive", dumpDOMAsWebArchiveCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpDatabaseCallbacks", dumpDatabaseCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -2445,6 +2435,7 @@ JSStaticFunction* LayoutTestController::staticFunctions() { "setBackingScaleFactor", setBackingScaleFactorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "preciseTime", preciseTimeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "setHasCustomFullScreenBehavior", setHasCustomFullScreenBehaviorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "setStorageDatabaseIdleInterval", setStorageDatabaseIdleIntervalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { 0, 0, 0 } }; diff --git a/Tools/DumpRenderTree/LayoutTestController.h b/Tools/DumpRenderTree/LayoutTestController.h index 54ca9278a..33bb16cdd 100644 --- a/Tools/DumpRenderTree/LayoutTestController.h +++ b/Tools/DumpRenderTree/LayoutTestController.h @@ -327,8 +327,6 @@ public: void abortModal(); - void dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight); - static void setSerializeHTTPLoads(bool serialize); // The following API test functions should probably be moved to platform-specific @@ -366,6 +364,8 @@ public: void setHasCustomFullScreenBehavior(bool value) { m_customFullScreenBehavior = value; } bool hasCustomFullScreenBehavior() const { return m_customFullScreenBehavior; } + void setStorageDatabaseIdleInterval(double); + private: LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp index 65dcaecd3..a3e97831b 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp @@ -208,6 +208,11 @@ void PluginTest::NPN_ReleaseObject(NPObject* npObject) browser->releaseobject(npObject); } +bool PluginTest::NPN_GetProperty(NPObject* npObject, NPIdentifier propertyName, NPVariant* value) +{ + return browser->getproperty(m_npp, npObject, propertyName, value); +} + bool PluginTest::NPN_RemoveProperty(NPObject* npObject, NPIdentifier propertyName) { return browser->removeproperty(m_npp, npObject, propertyName); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h index e83e82cfe..e7cd90326 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h @@ -65,7 +65,6 @@ public: virtual NPError NPP_DestroyStream(NPStream*, NPReason); virtual int32_t NPP_WriteReady(NPStream*); virtual int32_t NPP_Write(NPStream*, int32_t offset, int32_t len, void* buffer); - virtual int16_t NPP_HandleEvent(void* event); virtual bool NPP_URLNotify(const char* url, NPReason, void* notifyData); virtual NPError NPP_GetValue(NPPVariable, void* value); @@ -87,6 +86,7 @@ public: NPObject* NPN_CreateObject(NPClass*); NPObject* NPN_RetainObject(NPObject*); void NPN_ReleaseObject(NPObject*); + bool NPN_GetProperty(NPObject*, NPIdentifier propertyName, NPVariant* value); bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName); #ifdef XP_MACOSX diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/LeakWindowScriptableObject.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/LeakWindowScriptableObject.cpp new file mode 100644 index 000000000..93f52a28e --- /dev/null +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/LeakWindowScriptableObject.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2012 Google Inc. All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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. + */ + +#include "PluginTest.h" + +using namespace std; + +class LeakWindowScriptableObject : public PluginTest { +public: + LeakWindowScriptableObject(NPP npp, const string& identifier) + : PluginTest(npp, identifier) + { + } + +private: + virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved) + { + // Get a new reference to the window script object. + NPObject* window; + if (NPN_GetValue(NPNVWindowNPObject, &window) != NPERR_NO_ERROR) { + log("Fail: Cannot fetch window script object"); + return NPERR_NO_ERROR; + } + + // Get another reference to the same object via window.self. + NPIdentifier self_name = NPN_GetStringIdentifier("self"); + NPVariant window_self_variant; + if (!NPN_GetProperty(window, self_name, &window_self_variant)) { + log("Fail: Cannot query window.self"); + return NPERR_NO_ERROR; + } + if (!NPVARIANT_IS_OBJECT(window_self_variant)) { + log("Fail: window.self is not an object"); + return NPERR_NO_ERROR; + } + + // Leak both references to the window script object. + return NPERR_NO_ERROR; + } +}; + +static PluginTest::Register<LeakWindowScriptableObject> leakWindowScriptableObject("leak-window-scriptable-object"); diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp index a19742c33..11f390e3b 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp @@ -61,6 +61,7 @@ #include "WebPageClient.h" #include "WorkQueue.h" #include "WorkQueueItem.h" +#include <BlackBerryPlatformLayoutTest.h> #include <WebSettings.h> #include <stdio.h> #include <sys/stat.h> @@ -156,13 +157,12 @@ DumpRenderTree::DumpRenderTree(BlackBerry::WebKit::WebPage* page) , m_waitToDumpWatchdogTimer(this, &DumpRenderTree::waitToDumpWatchdogTimerFired) , m_workTimer(this, &DumpRenderTree::processWork) , m_acceptsEditing(true) - , m_runningRefTests(false) { + const char* workerNumber = getenv("WORKER_NUMBER") ? getenv("WORKER_NUMBER") : "0"; String sdcardPath = SDCARD_PATH; m_resultsDir = sdcardPath + "/results/"; - m_indexFile = sdcardPath + "/index.drt"; - m_doneFile = sdcardPath + "/done"; - m_currentTestFile = sdcardPath + "/current.drt"; + m_doneFile = sdcardPath + "/done" + workerNumber; + m_currentTestFile = sdcardPath + "/current" + workerNumber + ".drt"; m_page->resetVirtualViewportOnCommitted(false); m_page->setVirtualViewportSize(800, 600); s_currentInstance = this; @@ -200,36 +200,13 @@ void DumpRenderTree::doneDrt() { fclose(stdout); fclose(stderr); + unlink(getPPSPath().c_str()); // Notify the external world that we're done. createFile(m_doneFile); (m_page->client())->notifyRunLayoutTestsFinished(); } -void DumpRenderTree::getRefTests(const String& testName) -{ - if (m_runningRefTests) - return; - - const char* suffixes[] = {"-expected", "-expected-mismatch"}; - const int countofSuffixes = sizeof(suffixes) / sizeof(const char*); - // FIXME: Currently we only have ref tests with .html extension, you many need to add more - // when they have more extensions(.htm, .shtml, .xhtml, etc.). - const char* extensions[] = {".html", ".svg"}; - const int countofExtensions = sizeof(extensions) / sizeof(const char*); - String layoutDir = kSDCLayoutTestsURI + 7; // 7: strlen("file://"), layoutDir: "/developer/LayoutTests/" - - size_t iEnd = testName.reverseFind('.'); - - String nameWithoutExtension = testName.substring(0, iEnd); - for (int i = 0; i < countofSuffixes; ++i) - for (int j = 0; j < countofExtensions; ++j) { - String candidateFile = layoutDir + nameWithoutExtension + suffixes[i] + extensions[j]; - if (!access(candidateFile.utf8().data(), F_OK)) - m_refTests.append(nameWithoutExtension + suffixes[i] + extensions[j]); - } -} - void DumpRenderTree::runCurrentTest() { if (isHTTPTest(m_currentTest->utf8().data())) { @@ -247,20 +224,17 @@ void DumpRenderTree::runRemainingTests() fflush(stderr); if (m_currentTest >= m_tests.end() - 1) { - // Run ref-tests after real tests were finished - if (!m_runningRefTests && !m_refTests.isEmpty()) { - m_tests.clear(); - m_tests.append(m_refTests); - m_refTests.clear(); + m_tests.clear(); + if (m_bufferedTests.size() > 0) { + m_tests.append(m_bufferedTests); + m_bufferedTests.clear(); m_currentTest = m_tests.begin(); - m_runningRefTests = true; - } else { - doneDrt(); - return; + runCurrentTest(); } - } else - m_currentTest++; + return; + } + m_currentTest++; runCurrentTest(); } @@ -346,20 +320,35 @@ void DumpRenderTree::runTests() { m_gcController = new GCController(); m_accessibilityController = new AccessibilityController(); - getTestsToRun(); + if (!ensurePPS()) { + fprintf(stderr, "Failed to open PPS file '%s', error=%d\n", getPPSPath().c_str(), errno); + (m_page->client())->notifyRunLayoutTestsFinished(); + return; + } mainFrame = DumpRenderTreeSupport::corePage(m_page)->mainFrame(); - m_currentTest = m_tests.begin(); + // Get Test file name from PPS: /pps/services/drt/input + // Example: test_file::fast/js/arguments.html + waitForTest(); +} - if (m_currentTest == m_tests.end()) { +void DumpRenderTree::addTest(const char* testFile) +{ + String test(testFile); + if (test == "#DONE") doneDrt(); - return; + else if (!test.isEmpty()) { + if (m_tests.isEmpty()) { + // No test is being run, initialize iterator and start test + m_tests.append(test); + m_currentTest = m_tests.begin(); + runCurrentTest(); + } else + m_bufferedTests.append(test); } - runCurrentTest(); } - String DumpRenderTree::dumpFramesAsText(WebCore::Frame* frame) { String s; @@ -395,28 +384,6 @@ bool DumpRenderTree::isHTTPTest(const String& test) && testLower.substring(lenHttpTestSyntax, strlen(localTestSyntax)) != localTestSyntax; } -void DumpRenderTree::getTestsToRun() -{ - Vector<String> files; - - FILE* fd = fopen(m_indexFile.utf8().data(), "r"); - fseek(fd, 0, SEEK_END); - int size = ftell(fd); - fseek(fd, 0, SEEK_SET); - OwnArrayPtr<char> buf = adoptArrayPtr(new char[size]); - fread(buf.get(), 1, size, fd); - fclose(fd); - String s(buf.get(), size); - s.split("\n", files); - - m_tests = files; - - // Find ref-tests for each of the real tests, one test may have multiple expected ref-tests - // and multiple mismatch ref-tests. - for (Vector<String>::iterator iter = files.begin(); files.end() != iter; ++iter) - getRefTests(*iter); -} - void DumpRenderTree::invalidateAnyPreviousWaitToDumpWatchdog() { m_waitToDumpWatchdogTimer.stop(); @@ -511,6 +478,9 @@ static String dumpBackForwardListForWebView() void DumpRenderTree::dump() { + if (testDone) + return; + invalidateAnyPreviousWaitToDumpWatchdog(); String dumpFile = m_resultsDir + *m_currentTest + ".dump"; @@ -533,6 +503,9 @@ void DumpRenderTree::dump() String crashFile = dumpFile + ".crash"; unlink(crashFile.utf8().data()); + String doneFile = m_resultsDir + *m_currentTest + ".done"; + createFile(doneFile); + testDone = true; runRemainingTests(); } diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h b/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h index c6eba9d19..4ca9a3f2d 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h @@ -21,9 +21,11 @@ #include "BlackBerryGlobal.h" + #include "DumpRenderTreeClient.h" #include "PlatformString.h" #include "Timer.h" +#include <BlackBerryPlatformLayoutTest.h> #include <FindOptions.h> #include <wtf/Vector.h> @@ -45,7 +47,7 @@ namespace BlackBerry { namespace WebKit { class WebPage; -class DumpRenderTree : public BlackBerry::WebKit::DumpRenderTreeClient { +class DumpRenderTree : public BlackBerry::WebKit::DumpRenderTreeClient, public BlackBerry::Platform::LayoutTestClient { public: DumpRenderTree(WebPage*); virtual ~DumpRenderTree(); @@ -104,11 +106,12 @@ public: void setSelectTrailingWhitespaceEnabled(bool enabled) { s_selectTrailingWhitespaceEnabled = enabled; } bool didReceiveAuthenticationChallenge(WebCore::Credential&); + // BlackBerry::Platform::BlackBerryPlatformLayoutTestClient method + virtual void addTest(const char* testFile); private: void runTest(const String& url); void runTests(); void runCurrentTest(); - void getRefTests(const String& testName); void processWork(WebCore::Timer<DumpRenderTree>*); @@ -119,7 +122,6 @@ private: void locationChangeForFrame(WebCore::Frame*); void doneDrt(); - void getTestsToRun(); bool isHTTPTest(const String& test); String renderTreeDump() const; void resetToConsistentStateBeforeTesting(); @@ -129,10 +131,9 @@ private: Vector<String> m_tests; Vector<String>::iterator m_currentTest; - Vector<String> m_refTests; // Reference tests for current test + Vector<String> m_bufferedTests; String m_resultsDir; - String m_indexFile; String m_doneFile; String m_currentHttpTest; String m_currentTestFile; @@ -146,7 +147,6 @@ private: bool m_acceptsEditing; bool m_loadFinished; - bool m_runningRefTests; static bool s_selectTrailingWhitespaceEnabled; }; } diff --git a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp index ceadb7a63..1982b5a6c 100644 --- a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp +++ b/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp @@ -740,14 +740,6 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests() return DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()); } -void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight) -{ - if (!mainFrame) - return; - - DumpRenderTreeSupport::dumpConfigurationForViewport(mainFrame, deviceDPI, deviceWidth, deviceHeight, availableWidth, availableHeight); -} - bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebCore::FindOptions options = 0; diff --git a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h index f3564bd78..ea6e5aea6 100644 --- a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h +++ b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h @@ -88,7 +88,6 @@ private: TaskList m_taskList; DRTDevToolsClient* m_drtDevToolsClient; int m_routingID; - WebKit::WebDevToolsAgent* m_webDevToolsAgent; WebKit::WebView* m_webView; }; diff --git a/Tools/DumpRenderTree/chromium/GamepadController.cpp b/Tools/DumpRenderTree/chromium/GamepadController.cpp index d00b953d5..b38dfa0c5 100644 --- a/Tools/DumpRenderTree/chromium/GamepadController.cpp +++ b/Tools/DumpRenderTree/chromium/GamepadController.cpp @@ -35,8 +35,7 @@ using namespace WebKit; -GamepadController::GamepadController(TestShell* shell) - : m_shell(shell) +GamepadController::GamepadController(TestShell*) { bindMethod("connect", &GamepadController::connect); bindMethod("disconnect", &GamepadController::disconnect); diff --git a/Tools/DumpRenderTree/chromium/GamepadController.h b/Tools/DumpRenderTree/chromium/GamepadController.h index 414228855..5a6f40d5d 100644 --- a/Tools/DumpRenderTree/chromium/GamepadController.h +++ b/Tools/DumpRenderTree/chromium/GamepadController.h @@ -59,8 +59,6 @@ private: void setAxisData(const CppArgumentList&, CppVariant*); void fallbackCallback(const CppArgumentList&, CppVariant*); - TestShell* m_shell; - WebKit::WebGamepads internalData; }; diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp index 06f146c1c..d5c9019b8 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp @@ -38,9 +38,7 @@ #include "TestShell.h" #include "WebAnimationController.h" #include "WebBindings.h" -#include "WebWorkerInfo.h" #include "WebConsoleMessage.h" -#include "platform/WebData.h" #include "WebDeviceOrientation.h" #include "WebDeviceOrientationClientMock.h" #include "WebDocument.h" @@ -58,12 +56,15 @@ #include "WebPrintParams.h" #include "WebScriptSource.h" #include "WebSecurityPolicy.h" -#include "platform/WebSerializedScriptValue.h" #include "WebSettings.h" -#include "platform/WebSize.h" -#include "platform/WebURL.h" +#include "WebSurroundingText.h" #include "WebView.h" #include "WebViewHost.h" +#include "WebWorkerInfo.h" +#include "platform/WebData.h" +#include "platform/WebSerializedScriptValue.h" +#include "platform/WebSize.h" +#include "platform/WebURL.h" #include "v8/include/v8.h" #include "webkit/support/webkit_support.h" #include <algorithm> @@ -72,11 +73,8 @@ #include <cstdlib> #include <limits> #include <sstream> -#include <wtf/text/WTFString.h> - -#if OS(WINDOWS) #include <wtf/OwnArrayPtr.h> -#endif +#include <wtf/text/WTFString.h> #if OS(LINUX) || OS(ANDROID) #include "linux/WebFontRendering.h" @@ -221,6 +219,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy); bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled); bindMethod("setTextSubpixelPositioning", &LayoutTestController::setTextSubpixelPositioning); + bindMethod("setBackingScaleFactor", &LayoutTestController::setBackingScaleFactor); bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled); bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads); bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements); @@ -277,7 +276,8 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize); bindMethod("selectionAsMarkup", &LayoutTestController::selectionAsMarkup); bindMethod("setHasCustomFullScreenBehavior", &LayoutTestController::setHasCustomFullScreenBehavior); - + bindMethod("textSurroundingNode", &LayoutTestController::textSurroundingNode); + // The fallback method is called when an unknown method is invoked. bindFallbackMethod(&LayoutTestController::fallbackMethod); @@ -652,6 +652,7 @@ void LayoutTestController::reset() m_shell->webView()->removeAllUserContent(); WebKit::WebSize empty; m_shell->webView()->disableAutoResizeMode(); + m_shell->webView()->setDeviceScaleFactor(1); } m_dumpAsText = false; m_dumpAsAudio = false; @@ -1579,8 +1580,6 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments, prefs->allowDisplayOfInsecureContent = cppVariantToBool(value); else if (key == "WebKitAllowRunningInsecureContent") prefs->allowRunningOfInsecureContent = cppVariantToBool(value); - else if (key == "WebKitHixie76WebSocketProtocolEnabled") - prefs->hixie76WebSocketProtocolEnabled = cppVariantToBool(value); else if (key == "WebKitCSSCustomFilterEnabled") prefs->cssCustomFilterEnabled = cppVariantToBool(value); else if (key == "WebKitWebAudioEnabled") { @@ -2211,6 +2210,40 @@ void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arg result->setNull(); } +class InvokeCallbackTask : public MethodTask<LayoutTestController> { +public: + InvokeCallbackTask(LayoutTestController* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) + : MethodTask<LayoutTestController>(object) + , m_callbackArguments(callbackArguments) + , m_numberOfArguments(numberOfArguments) + { + } + + virtual void runIfValid() + { + CppVariant invokeResult; + m_callbackArguments[0].invokeDefault(m_callbackArguments.get(), m_numberOfArguments, invokeResult); + } + +private: + OwnArrayPtr<CppVariant> m_callbackArguments; + uint32_t m_numberOfArguments; +}; + +void LayoutTestController::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) +{ + if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isObject()) + return; + + float value = arguments[0].value.doubleValue; + m_shell->webView()->setDeviceScaleFactor(value); + + OwnArrayPtr<CppVariant> callbackArguments = adoptArrayPtr(new CppVariant[1]); + callbackArguments[0].set(arguments[1]); + result->setNull(); + postTask(new InvokeCallbackTask(this, callbackArguments.release(), 1)); +} + void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { @@ -2310,3 +2343,27 @@ void LayoutTestController::setPointerLockWillFailSynchronously(const CppArgument result->setNull(); } #endif + +void LayoutTestController::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + if (arguments.size() < 4 || !arguments[0].isObject() || !arguments[1].isNumber() || !arguments[2].isNumber() || !arguments[3].isNumber()) + return; + + WebNode node; + if (!WebBindings::getNode(arguments[0].value.objectValue, &node)) + return; + + if (node.isNull() || !node.isTextNode()) + return; + + WebPoint point(arguments[1].toInt32(), arguments[2].toInt32()); + unsigned maxLength = arguments[3].toInt32(); + + WebSurroundingText surroundingText; + surroundingText.initialize(node, point, maxLength); + if (surroundingText.isNull()) + return; + + result->set(surroundingText.textContent().utf8()); +} diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/LayoutTestController.h index af39b2ef6..08c724410 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.h +++ b/Tools/DumpRenderTree/chromium/LayoutTestController.h @@ -453,6 +453,15 @@ public: // resulting in the changed setting being ignored. void setTextSubpixelPositioning(const CppArgumentList&, CppVariant*); + // Used to set the device scale factor. + void setBackingScaleFactor(const CppArgumentList&, CppVariant*); + + // Retrieves the text surrounding a position in a text node. + // Expects the first argument to be a text node, the second and third to be + // point coordinates relative to the node and the fourth the maximum text + // length to retrieve. + void textSurroundingNode(const CppArgumentList&, CppVariant*); + public: // The following methods are not exposed to JavaScript. void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); } diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.h b/Tools/DumpRenderTree/chromium/NotificationPresenter.h index b33df9138..5fed178da 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.h +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.h @@ -43,7 +43,7 @@ class TestShell; // A class that implements WebNotificationPresenter for DRT. class NotificationPresenter : public WebKit::WebNotificationPresenter { public: - explicit NotificationPresenter(TestShell* shell) : m_shell(shell) { } + explicit NotificationPresenter(TestShell*) { } virtual ~NotificationPresenter(); // Called by the LayoutTestController to simulate a user granting permission. @@ -62,9 +62,6 @@ public: void reset() { m_allowedOrigins.clear(); } private: - // Non-owned pointer. The NotificationPresenter is owned by the test shell. - TestShell* m_shell; - // Set of allowed origins. HashSet<WTF::String> m_allowedOrigins; diff --git a/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp b/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp index f4cbf5e1f..bc0acaad9 100644 --- a/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp +++ b/Tools/DumpRenderTree/chromium/TestShellAndroid.cpp @@ -102,9 +102,7 @@ void redirectToFile(FILE* stream, const char* path, const char* mode) void platformInit(int* argc, char*** argv) { // Initialize skia with customized font config files. - // FIXME: Add this call once SkUseTestFontConfigFile is added to Skia and - // visible to WebKit. See https://bugs.webkit.org/show_bug.cgi?id=89801 - // SkUseTestFontConfigFile(fontMainConfigFile, fontFallbackConfigFile, fontsDir); + SkUseTestFontConfigFile(fontMainConfigFile, fontFallbackConfigFile, fontsDir); const char* inFIFO = 0; const char* outFIFO = 0; diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp index a779ee9c3..c4de0abc1 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp @@ -116,7 +116,6 @@ void WebPreferences::reset() deferred2dCanvasEnabled = false; acceleratedPaintingEnabled = false; forceCompositingMode = false; - hixie76WebSocketProtocolEnabled = true; mediaPlaybackRequiresUserGesture = false; mockScrollbarsEnabled = false; cssCustomFilterEnabled = false; @@ -225,7 +224,6 @@ void WebPreferences::applyTo(WebView* webView) settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled); settings->setDeferred2dCanvasEnabled(deferred2dCanvasEnabled); settings->setAcceleratedPaintingEnabled(acceleratedPaintingEnabled); - settings->setHixie76WebSocketProtocolEnabled(hixie76WebSocketProtocolEnabled); settings->setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture); settings->setMockScrollbarsEnabled(mockScrollbarsEnabled); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h index d42f9b075..c36553b35 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.h +++ b/Tools/DumpRenderTree/chromium/WebPreferences.h @@ -109,7 +109,6 @@ struct WebPreferences { bool accelerated2dCanvasEnabled; bool deferred2dCanvasEnabled; bool acceleratedPaintingEnabled; - bool hixie76WebSocketProtocolEnabled; bool mediaPlaybackRequiresUserGesture; bool mockScrollbarsEnabled; bool cssCustomFilterEnabled; diff --git a/Tools/DumpRenderTree/efl/CMakeLists.txt b/Tools/DumpRenderTree/efl/CMakeLists.txt index 0a8fd065b..e1dacf901 100644 --- a/Tools/DumpRenderTree/efl/CMakeLists.txt +++ b/Tools/DumpRenderTree/efl/CMakeLists.txt @@ -29,6 +29,7 @@ SET(DumpRenderTree_LIBRARIES ${WebCoreTestSupport_LIBRARY_NAME} ${WebCore_LIBRARY_NAME} ${WebKit_LIBRARY_NAME} + ${WTF_LIBRARY_NAME} ${CAIRO_LIBRARIES} ${ECORE_X_LIBRARIES} ${EDJE_LIBRARIES} diff --git a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp b/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp index 070af8c14..3352fe678 100644 --- a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp +++ b/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp @@ -833,14 +833,6 @@ void LayoutTestController::abortModal() notImplemented(); } -void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight) -{ - DumpRenderTreeSupportEfl::dumpConfigurationForViewport(browser->mainView(), - deviceDPI, - WebCore::IntSize(deviceWidth, deviceHeight), - WebCore::IntSize(availableWidth, availableHeight)); -} - void LayoutTestController::setSerializeHTTPLoads(bool serialize) { DumpRenderTreeSupportEfl::setSerializeHTTPLoads(serialize); @@ -928,3 +920,8 @@ void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type { DumpRenderTreeSupportEfl::deliverWebIntent(browser->mainFrame(), action, type, data); } + +void LayoutTestController::setStorageDatabaseIdleInterval(double) +{ + notImplemented(); +} diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp index 19b966695..8e3c44ec3 100644 --- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -123,7 +123,29 @@ static bool shouldEnableDeveloperExtras(const string& pathOrURL) void dumpFrameScrollPosition(WebKitWebFrame* frame) { + WebKitDOMDocument* document = webkit_web_frame_get_dom_document(frame); + if (!document) + return; + + WebKitDOMDOMWindow* domWindow = webkit_dom_document_get_default_view(document); + if (!domWindow) + return; + + glong x = webkit_dom_dom_window_get_page_x_offset(domWindow); + glong y = webkit_dom_dom_window_get_page_y_offset(domWindow); + + if (abs(x) > 0 || abs(y) > 0) { + if (webkit_web_frame_get_parent(frame)) + printf("frame '%s' ", webkit_web_frame_get_name(frame)); + printf("scrolled to %ld,%ld\n", x, y); + } + if (gLayoutTestController->dumpChildFrameScrollPositions()) { + GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame); + for (GSList* child = children; child; child = g_slist_next(child)) + dumpFrameScrollPosition(static_cast<WebKitWebFrame*>(child->data)); + g_slist_free(children); + } } void displayWebView() @@ -169,6 +191,32 @@ CString getTopLevelPath() return TOP_LEVEL_DIR; } +CString getOutputDir() +{ + const char* webkitOutputDir = g_getenv("WEBKITOUTPUTDIR"); + if (webkitOutputDir) + return webkitOutputDir; + + CString topLevelPath = getTopLevelPath(); + GOwnPtr<char> outputDir(g_build_filename(topLevelPath.data(), "WebKitBuild", NULL)); + return outputDir.get(); +} + +static CString getFontsPath() +{ + CString webkitOutputDir = getOutputDir(); + GOwnPtr<char> fontsPath(g_build_filename(webkitOutputDir.data(), "Dependencies", "Root", "webkitgtk-test-fonts", NULL)); + if (g_file_test(fontsPath.get(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) + return fontsPath.get(); + + // Try alternative fonts path. + fontsPath.set(g_build_filename(webkitOutputDir.data(), "webkitgtk-test-fonts", NULL)); + if (g_file_test(fontsPath.get(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) + return fontsPath.get(); + + return CString(); +} + static void initializeFonts(const char* testURL = 0) { #if PLATFORM(X11) @@ -190,18 +238,16 @@ static void initializeFonts(const char* testURL = 0) if (!FcConfigParseAndLoad(config, reinterpret_cast<FcChar8*>(fontConfigFilename.get()), true)) g_error("Couldn't load font configuration file from: %s", fontConfigFilename.get()); - CString topLevelPath = getTopLevelPath(); - GOwnPtr<char> fontsPath(g_build_filename(topLevelPath.data(), "WebKitBuild", "Dependencies", - "Root", "webkitgtk-test-fonts", NULL)); - if (!g_file_test(fontsPath.get(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) - g_error("Could not locate test fonts at %s. Is WEBKIT_TOP_LEVEL set?", fontsPath.get()); + CString fontsPath = getFontsPath(); + if (fontsPath.isNull()) + g_error("Could not locate test fonts at %s. Is WEBKIT_TOP_LEVEL set?", fontsPath.data()); GOwnPtr<GError> error; - GOwnPtr<GDir> fontsDirectory(g_dir_open(fontsPath.get(), 0, &error.outPtr())); + GOwnPtr<GDir> fontsDirectory(g_dir_open(fontsPath.data(), 0, &error.outPtr())); while (const char* directoryEntry = g_dir_read_name(fontsDirectory.get())) { if (!g_str_has_suffix(directoryEntry, ".ttf") && !g_str_has_suffix(directoryEntry, ".otf")) continue; - GOwnPtr<gchar> fontPath(g_build_filename(fontsPath.get(), directoryEntry, NULL)); + GOwnPtr<gchar> fontPath(g_build_filename(fontsPath.data(), directoryEntry, NULL)); if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(fontPath.get()))) g_error("Could not load font at %s!", fontPath.get()); @@ -466,7 +512,8 @@ static void resetDefaultsToConsistentValues() DumpRenderTreeSupportGtk::resetGeolocationClientMock(webView); - DumpRenderTreeSupportGtk::setHixie76WebSocketProtocolEnabled(webView, true); + DumpRenderTreeSupportGtk::setCSSGridLayoutEnabled(webView, false); + DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webView, true); } static bool useLongRunningServerMode(int argc, char *argv[]) diff --git a/Tools/DumpRenderTree/gtk/EventSender.cpp b/Tools/DumpRenderTree/gtk/EventSender.cpp index 102bb660f..4cc2ab34b 100644 --- a/Tools/DumpRenderTree/gtk/EventSender.cpp +++ b/Tools/DumpRenderTree/gtk/EventSender.cpp @@ -35,7 +35,6 @@ #include "DumpRenderTree.h" #include "WebCoreSupport/DumpRenderTreeSupportGtk.h" -#include "WebKitMutationObserver.h" #include <GOwnPtrGtk.h> #include <GRefPtrGtk.h> #include <GtkVersioning.h> diff --git a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp index 72d69fa0a..2eb899d61 100644 --- a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp @@ -801,12 +801,15 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value else if (g_str_equal(originalName.get(), "WebKitTabToLinksPreferenceKey")) { DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(booleanFromValue(valueAsString.get())); return; - } else if (g_str_equal(originalName.get(), "WebKitHixie76WebSocketProtocolEnabled")) { - DumpRenderTreeSupportGtk::setHixie76WebSocketProtocolEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); - return; } else if (g_str_equal(originalName.get(), "WebKitPageCacheSupportsPluginsPreferenceKey")) { DumpRenderTreeSupportGtk::setPageCacheSupportsPlugins(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); return; + } else if (g_str_equal(originalName.get(), "WebKitCSSGridLayoutEnabled")) { + DumpRenderTreeSupportGtk::setCSSGridLayoutEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); + return; + } else if (g_str_equal(originalName.get(), "WebKitCSSRegionsEnabled")) { + DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); + return; } else { fprintf(stderr, "LayoutTestController::overridePreference tried to override " "unknown preference '%s'.\n", originalName.get()); @@ -937,13 +940,6 @@ void LayoutTestController::abortModal() { } -void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight) -{ - WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); - ASSERT(webView); - DumpRenderTreeSupportGtk::dumpConfigurationForViewport(webView, deviceDPI, deviceWidth, deviceHeight, availableWidth, availableHeight); -} - void LayoutTestController::setSerializeHTTPLoads(bool serialize) { DumpRenderTreeSupportGtk::setSerializeHTTPLoads(serialize); @@ -1004,3 +1000,8 @@ void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRe { // FIXME: Implement this. } + +void LayoutTestController::setStorageDatabaseIdleInterval(double) +{ + // FIXME: Implement this. +} diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm index 271683f7a..dd0eff44b 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm @@ -661,9 +661,9 @@ static void resetDefaultsToConsistentValues() #endif [preferences setWebGLEnabled:NO]; [preferences setCSSRegionsEnabled:YES]; + [preferences setCSSGridLayoutEnabled:NO]; [preferences setUsePreHTML5ParserQuirks:NO]; [preferences setAsynchronousSpellCheckingEnabled:NO]; - [preferences setHixie76WebSocketProtocolEnabled:NO]; [preferences setMockScrollbarsEnabled:YES]; #if ENABLE(WEB_AUDIO) @@ -861,8 +861,6 @@ void dumpRenderTree(int argc, const char *argv[]) [[NSURLCache sharedURLCache] removeAllCachedResponses]; [WebCache empty]; - // <http://webkit.org/b/31200> In order to prevent extra frame load delegate logging being generated if the first test to use SSL - // is set to log frame load delegate calls we ignore SSL certificate errors on localhost and 127.0.0.1. [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:@"localhost"]; [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:@"127.0.0.1"]; diff --git a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm index 884572e9b..f360c061a 100644 --- a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm @@ -201,6 +201,11 @@ void LayoutTestController::deleteAllLocalStorage() [[WebStorageManager sharedWebStorageManager] deleteAllOrigins]; } +void LayoutTestController::setStorageDatabaseIdleInterval(double interval) +{ + [WebStorageManager setStorageDatabaseIdleInterval:interval]; +} + JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) { return originsArrayToJS(context, [[WebStorageManager sharedWebStorageManager] origins]); @@ -1118,11 +1123,6 @@ void LayoutTestController::abortModal() [NSApp abortModal]; } -void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/) -{ - -} - void LayoutTestController::setSerializeHTTPLoads(bool serialize) { [WebView _setLoadResourcesSerially:serialize]; diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index 327dc3a79..f47fb4344 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -9,8 +9,6 @@ TEMPLATE = app TARGET = DumpRenderTree DESTDIR = $$ROOT_BUILD_DIR/bin -load(features) - WEBKIT += wtf webcore !v8: WEBKIT += javascriptcore diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 9d0ae62ac..12d659a51 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -191,10 +191,12 @@ void WebPage::resetSettings() settings()->resetAttribute(QWebSettings::ZoomTextOnly); settings()->resetAttribute(QWebSettings::CSSRegionsEnabled); settings()->resetAttribute(QWebSettings::CSSGridLayoutEnabled); + settings()->resetAttribute(QWebSettings::AcceleratedCompositingEnabled); m_drt->layoutTestController()->setCaretBrowsingEnabled(false); m_drt->layoutTestController()->setAuthorAndUserStylesEnabled(true); m_drt->layoutTestController()->setFrameFlatteningEnabled(false); + m_drt->layoutTestController()->setMockScrollbarsEnabled(false); m_drt->layoutTestController()->setSmartInsertDeleteEnabled(true); m_drt->layoutTestController()->setSelectTrailingWhitespaceEnabled(false); m_drt->layoutTestController()->setDefersLoading(false); @@ -206,7 +208,6 @@ void WebPage::resetSettings() settings()->setUserStyleSheetUrl(QUrl()); // reset to default DumpRenderTreeSupportQt::setMinimumTimerInterval(this, DumpRenderTreeSupportQt::defaultMinimumTimerInterval()); - DumpRenderTreeSupportQt::setHixie76WebSocketProtocolEnabled(this, DumpRenderTreeSupportQt::defaultHixie76WebSocketProtocolEnabled()); DumpRenderTreeSupportQt::resetInternalsObject(mainFrame()); @@ -536,10 +537,11 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) #ifndef QT_NO_UNDOSTACK m_page->undoStack()->clear(); #endif - + clearHistory(m_page); DumpRenderTreeSupportQt::scalePageBy(m_page->mainFrame(), 1, QPoint(0, 0)); DumpRenderTreeSupportQt::clearFrameName(m_page->mainFrame()); + DumpRenderTreeSupportQt::removeUserStyleSheets(m_page); m_page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded); m_page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded); diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index b8f998947..bc88cb48f 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -258,12 +258,6 @@ QString LayoutTestController::pathToLocalResource(const QString& url) return url; } -void LayoutTestController::dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight) -{ - QString res = DumpRenderTreeSupportQt::viewportAsText(m_drt->webPage(), deviceDPI, QSize(deviceWidth, deviceHeight), QSize(availableWidth, availableHeight)); - fputs(qPrintable(res), stdout); -} - void LayoutTestController::dumpEditingCallbacks() { qDebug() << ">>>dumpEditingCallbacks"; @@ -442,6 +436,11 @@ void LayoutTestController::setFrameFlatteningEnabled(bool enabled) DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled); } +void LayoutTestController::setMockScrollbarsEnabled(bool enabled) +{ + DumpRenderTreeSupportQt::setMockScrollbarsEnabled(m_drt->webPage(), enabled); +} + void LayoutTestController::goBack() { DumpRenderTreeSupportQt::goBack(m_drt->webPage()); @@ -673,8 +672,6 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian settings->setAttribute(QWebSettings::CSSGridLayoutEnabled, value.toBool()); else if (name == "WebKitHyperlinkAuditingEnabled") settings->setAttribute(QWebSettings::HyperlinkAuditingEnabled, value.toBool()); - else if (name == "WebKitHixie76WebSocketProtocolEnabled") - DumpRenderTreeSupportQt::setHixie76WebSocketProtocolEnabled(m_topLoadingFrame->page(), value.toBool()); else if (name == "WebKitAcceleratedCompositingEnabled") settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, value.toBool()); else diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h index 88b57cffa..b54f2f7e8 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -120,7 +120,6 @@ public slots: void dumpResourceResponseMIMETypes(); void dumpWillCacheResponse(); void dumpHistoryCallbacks(); - void dumpConfigurationForViewport(int deviceDPI, int deviceWidth, int deviceHeight, int availableWidth, int availableHeight); void setWillSendRequestReturnsNullOnRedirect(bool enabled); void setWillSendRequestReturnsNull(bool enabled); void setWillSendRequestClearHeader(const QStringList& headers); @@ -154,6 +153,7 @@ public slots: void removeAllVisitedLinks(); void setMediaType(const QString& type); void setFrameFlatteningEnabled(bool enable); + void setMockScrollbarsEnabled(bool enable); void setAllowUniversalAccessFromFileURLs(bool enable); void setAllowFileAccessFromFileURLs(bool enable); void setAppCacheMaximumSize(unsigned long long quota); diff --git a/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp b/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp index 7ae5e22a3..c69347e8d 100644 --- a/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp +++ b/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp @@ -62,17 +62,8 @@ void initializeTestFonts() ); } - QByteArray configFile; + QByteArray configFile = fontDir + "/fonts.conf"; FcConfig* config = FcConfigCreate(); - // The resolving of default font families was altered in Qt5 with 2cc5442 (qtbase), - // we use this hack to keep resolving to the same font Qt4 did for serif while - // supporting both versions. -#if HAVE(QT5) - configFile = fontDir + "/fonts-qt5-wk1.conf"; - if (!FcConfigParseAndLoad(config, reinterpret_cast<const FcChar8*>(configFile.constData()), FcTrue)) - qFatal("Couldn't load font configuration file"); -#endif - configFile = fontDir + "/fonts.conf"; if (!FcConfigParseAndLoad(config, reinterpret_cast<const FcChar8*>(configFile.constData()), FcTrue)) qFatal("Couldn't load font configuration file"); if (!FcConfigAppFontAddDir(config, reinterpret_cast<const FcChar8*>(fontDir.data()))) diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp index a6f583f60..f402a02ca 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp @@ -866,7 +866,6 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences) prefsPrivate->setFrameFlatteningEnabled(FALSE); prefsPrivate->setOfflineWebApplicationCacheEnabled(TRUE); prefsPrivate->setLoadsSiteIconsIgnoringImageLoadingPreference(FALSE); - prefsPrivate->setHixie76WebSocketProtocolEnabled(FALSE); } setAlwaysAcceptCookies(false); diff --git a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp index 9d03abc77..ce27ad320 100644 --- a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp @@ -1374,11 +1374,6 @@ void LayoutTestController::abortModal() { } -void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/) -{ - // FIXME: Implement this. -} - void LayoutTestController::setSerializeHTTPLoads(bool) { // FIXME: Implement. @@ -1483,3 +1478,8 @@ void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRe { // FIXME: Implement this. } + +void LayoutTestController::setStorageDatabaseIdleInterval(double) +{ + // FIXME: Implement this. +} diff --git a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp index e0c05843d..5935eab25 100644 --- a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp @@ -531,11 +531,6 @@ void LayoutTestController::abortModal() { } -void LayoutTestController::dumpConfigurationForViewport(int /*deviceDPI*/, int /*deviceWidth*/, int /*deviceHeight*/, int /*availableWidth*/, int /*availableHeight*/) -{ - // FIXME: Implement -} - JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const { // FIXME: Implement |