diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-14 16:29:47 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-14 16:29:47 +0200 |
commit | d0424a769059c84ae20beb3c217812792ea6726b (patch) | |
tree | 6f94a5c3db8c52c6694ee56498542a6c35417350 /Tools/DumpRenderTree | |
parent | 88a04ac016f57c2d78e714682445dff2e7db4ade (diff) | |
download | qtwebkit-d0424a769059c84ae20beb3c217812792ea6726b.tar.gz |
Imported WebKit commit 37c5e5041d39a14ea0d429a77ebd352e4bd26516 (http://svn.webkit.org/repository/webkit/trunk@128608)
New snapshot that enables WebKit2 build on Windows (still some bugs) and allows for WebKit to be built with qmake && make
Diffstat (limited to 'Tools/DumpRenderTree')
19 files changed, 190 insertions, 63 deletions
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp index df68ced94..8e3347ca8 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp +++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp @@ -195,7 +195,7 @@ '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak', - '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak', ]}, 'inputs': [ '<(repack_path)', @@ -452,9 +452,9 @@ 'target_name': 'DumpRenderTree_apk', 'type': 'none', 'dependencies': [ - '<(chromium_src_dir)/base/base.gyp:base_java', - '<(chromium_src_dir)/net/net.gyp:net_java', + '<(chromium_src_dir)/base/base.gyp:base', '<(chromium_src_dir)/media/media.gyp:media_java', + '<(chromium_src_dir)/net/net.gyp:net', 'DumpRenderTree', ], 'variables': { diff --git a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj index eb5cda1be..55b6ef290 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj +++ b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj @@ -70,6 +70,7 @@ 4437730F125CBC4D00AAE02C /* WebArchiveDumpSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */; }; 4AD6A11413C8124000EA9737 /* FormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4AD6A11313C8124000EA9737 /* FormValue.cpp */; }; 5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5106803D15CC7B10001A8A23 /* SlowNPPNew.cpp */; }; + 51134C9916014FDC001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51134C9816014FDB001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp */; }; 5113DE6715F6CBE5005EC8B3 /* NPPNewFails.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5113DE6615F6CBE5005EC8B3 /* NPPNewFails.cpp */; }; 515C0CD015EE785700F5A613 /* LogNPPSetWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515C0CCF15EE785700F5A613 /* LogNPPSetWindow.cpp */; }; 515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */; }; @@ -287,6 +288,7 @@ 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebArchiveDumpSupport.cpp; path = cf/WebArchiveDumpSupport.cpp; sourceTree = "<group>"; }; 4AD6A11313C8124000EA9737 /* FormValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormValue.cpp; sourceTree = "<group>"; }; 5106803D15CC7B10001A8A23 /* SlowNPPNew.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SlowNPPNew.cpp; path = TestNetscapePlugIn/Tests/SlowNPPNew.cpp; sourceTree = SOURCE_ROOT; }; + 51134C9816014FDB001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InvokeDestroysPluginWithinNPP_New.cpp; sourceTree = "<group>"; }; 5113DE6615F6CBE5005EC8B3 /* NPPNewFails.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPPNewFails.cpp; sourceTree = "<group>"; }; 515C0CCF15EE785700F5A613 /* LogNPPSetWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogNPPSetWindow.cpp; sourceTree = "<group>"; }; 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableObjectOverridesAllProperties.cpp; sourceTree = "<group>"; }; @@ -559,6 +561,7 @@ 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */, 1A3E28A91311D73B00501349 /* GetURLWithJavaScriptURLDestroyingPlugin.cpp */, 1AD4CB2012A6D1350027A7AF /* GetUserAgentWithNullNPPFromNPPNew.cpp */, + 51134C9816014FDB001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp */, 515C0CCF15EE785700F5A613 /* LogNPPSetWindow.cpp */, 1ACF898B132EF41C00E915D4 /* NPDeallocateCalledBeforeNPShutdown.cpp */, 5113DE6615F6CBE5005EC8B3 /* NPPNewFails.cpp */, @@ -925,6 +928,7 @@ 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */, 515C0CD015EE785700F5A613 /* LogNPPSetWindow.cpp in Sources */, 5113DE6715F6CBE5005EC8B3 /* NPPNewFails.cpp in Sources */, + 51134C9916014FDC001AA513 /* InvokeDestroysPluginWithinNPP_New.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp index 540b75699..b884503af 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp @@ -166,6 +166,11 @@ void PluginTest::NPN_InvalidateRect(NPRect* invalidRect) browser->invalidaterect(m_npp, invalidRect); } +bool PluginTest::NPN_Invoke(NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result) +{ + return browser->invoke(m_npp, npobj, methodName, args, argCount, result); +} + void* PluginTest::NPN_MemAlloc(uint32_t size) { return browser->memalloc(size); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h index 482d4cc35..ab64f2521 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h @@ -76,6 +76,7 @@ public: NPError NPN_GetURLNotify(const char* url, const char* target, void* notifyData); NPError NPN_GetValue(NPNVariable, void* value); void NPN_InvalidateRect(NPRect* invalidRect); + bool NPN_Invoke(NPObject *, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result); void* NPN_MemAlloc(uint32_t size); // NPRuntime NPN functions. diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/InvokeDestroysPluginWithinNPP_New.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/InvokeDestroysPluginWithinNPP_New.cpp new file mode 100644 index 000000000..0e2dbdce7 --- /dev/null +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/InvokeDestroysPluginWithinNPP_New.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2012 Apple 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" + +#include "PluginObject.h" + +using namespace std; + +// Executing JS within NPP_New when initializing asynchronously should not be able to deadlock with the WebProcess + +class InvokeDestroysPluginWithinNPP_New : public PluginTest { +public: + InvokeDestroysPluginWithinNPP_New(NPP, const string& identifier); + +private: + virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *); + +}; + +InvokeDestroysPluginWithinNPP_New::InvokeDestroysPluginWithinNPP_New(NPP npp, const string& identifier) + : PluginTest(npp, identifier) +{ +} + +NPError InvokeDestroysPluginWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) +{ + // Give the WebProcess enough time to be deadlocked waiting for the PluginProcess if things aren't working correctly. + usleep(15000); + + NPObject* windowObject = 0; + if (NPN_GetValue(NPNVWindowNPObject, &windowObject) != NPERR_NO_ERROR) + return NPERR_GENERIC_ERROR; + + if (!windowObject) + return NPERR_GENERIC_ERROR; + + NPVariant result; + if (!NPN_Invoke(windowObject, NPN_GetStringIdentifier("removePluginElement"), 0, 0, &result)) + return NPERR_GENERIC_ERROR; + + return NPERR_NO_ERROR; +} + +static PluginTest::Register<InvokeDestroysPluginWithinNPP_New> registrar("invoke-destroys-plugin-within-npp-new"); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp index c4de0abc1..5eebf596d 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp @@ -226,6 +226,7 @@ void WebPreferences::applyTo(WebView* webView) settings->setAcceleratedPaintingEnabled(acceleratedPaintingEnabled); settings->setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture); settings->setMockScrollbarsEnabled(mockScrollbarsEnabled); + settings->setApplyDefaultDeviceScaleFactorInCompositor(forceCompositingMode); // Fixed values. settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 55e4d84f8..87a913fc6 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -251,12 +251,13 @@ static string textAffinityDescription(WebTextAffinity affinity) // WebViewClient ------------------------------------------------------------- -WebView* WebViewHost::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) +WebView* WebViewHost::createView(WebFrame* creator, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) { if (!testRunner()->canOpenWindows()) return 0; if (testRunner()->shouldDumpCreateView()) fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str()); + creator->consumeUserGesture(); return m_shell->createNewWindow(WebURL())->webView(); } diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp index 97375dec5..6e23dd301 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp @@ -98,6 +98,7 @@ Evas_Object* DumpRenderTreeChrome::createView() const ewk_view_theme_set(view, DATA_DIR"/default.edj"); + evas_object_smart_callback_add(view, "download,request", onDownloadRequest, 0); evas_object_smart_callback_add(view, "load,resource,failed", onResourceLoadFailed, 0); evas_object_smart_callback_add(view, "load,resource,finished", onResourceLoadFinished, 0); evas_object_smart_callback_add(view, "load,started", onLoadStarted, 0); @@ -890,3 +891,19 @@ void DumpRenderTreeChrome::onFrameIntentServiceRegistration(void*, Evas_Object*, serviceInfo->href, serviceInfo->disposition); } + +void DumpRenderTreeChrome::onDownloadRequest(void*, Evas_Object*, void* eventInfo) +{ + // In case of "download,request", the URL need to be downloaded, not opened on the current view. + // Because there is no download agent for the DumpRenderTree, + // create a new view and load the URL on that view just for a test. + Evas_Object* newView = browser->createView(); + if (!newView) + return; + + Ewk_Download* download = static_cast<Ewk_Download*>(eventInfo); + ewk_view_theme_set(newView, DATA_DIR"/default.edj"); + ewk_view_uri_set(newView, download->url); + + browser->m_extraViews.append(newView); +} diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h index db3b19760..267c20003 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h @@ -141,6 +141,8 @@ private: static void onFrameIntentNew(void*, Evas_Object*, void*); static void onFrameIntentServiceRegistration(void*, Evas_Object*, void*); + + static void onDownloadRequest(void*, Evas_Object*, void*); }; #endif // DumpRenderTreeChrome_h diff --git a/Tools/DumpRenderTree/efl/FontManagement.cpp b/Tools/DumpRenderTree/efl/FontManagement.cpp index dcd425381..df8a150d5 100644 --- a/Tools/DumpRenderTree/efl/FontManagement.cpp +++ b/Tools/DumpRenderTree/efl/FontManagement.cpp @@ -1,6 +1,7 @@ /* * Copyright (C) 2011 ProFUSION Embedded Systems * Copyright (C) 2011 Samsung Electronics + * Copyright (C) 2012 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -31,49 +32,88 @@ #include <fontconfig/fontconfig.h> #include <wtf/Vector.h> #include <wtf/text/CString.h> -#include <wtf/text/WTFString.h> +#include <wtf/text/StringBuilder.h> -static Vector<String> getFontFiles() +static CString buildPath(const char* base, const char* first, ...) { - Vector<String> fontFilePaths; + va_list ap; + StringBuilder result; + result.append(base); + + if (const char* current = first) { + va_start(ap, first); + do { + result.append('/'); + result.append(current); + } while ((current = va_arg(ap, const char*))); + va_end(ap); + } + + return result.toString().utf8(); +} + +static Vector<CString> getCoreFontFiles() +{ + Vector<CString> fontFilePaths; // Ahem is used by many layout tests. - fontFilePaths.append(String(FONTS_CONF_DIR "/AHEM____.TTF")); + fontFilePaths.append(CString(FONTS_CONF_DIR "/AHEM____.TTF")); // A font with no valid Fontconfig encoding to test https://bugs.webkit.org/show_bug.cgi?id=47452 - fontFilePaths.append(String(FONTS_CONF_DIR "/FontWithNoValidEncoding.fon")); + fontFilePaths.append(CString(FONTS_CONF_DIR "/FontWithNoValidEncoding.fon")); for (int i = 1; i <= 9; i++) { - char fontPath[PATH_MAX]; - snprintf(fontPath, PATH_MAX - 1, - FONTS_CONF_DIR "/../../fonts/WebKitWeightWatcher%i00.ttf", i); - - fontFilePaths.append(String(fontPath)); + char fontPath[EINA_PATH_MAX]; + snprintf(fontPath, EINA_PATH_MAX - 1, FONTS_CONF_DIR "/../../fonts/WebKitWeightWatcher%i00.ttf", i); + fontFilePaths.append(CString(fontPath)); } return fontFilePaths; } -static bool addFontDirectory(const CString& fontDirectory, FcConfig* config) +static void addFontDirectory(const CString& fontDirectory, FcConfig* config) { - const char* path = fontDirectory.data(); + const char* fontPath = fontDirectory.data(); + if (!fontPath || !FcConfigAppFontAddDir(config, reinterpret_cast<const FcChar8*>(fontPath))) + fprintf(stderr, "Could not add font directory %s!\n", fontPath); +} - if (!ecore_file_is_dir(path) - || !FcConfigAppFontAddDir(config, reinterpret_cast<const FcChar8*>(path))) { - fprintf(stderr, "Could not add font directory %s!\n", path); - return false; +static void addFontFiles(const Vector<CString>& fontFiles, FcConfig* config) +{ + Vector<CString>::const_iterator it, end = fontFiles.end(); + for (it = fontFiles.begin(); it != end; ++it) { + const char* filePath = (*it).data(); + if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(filePath))) + fprintf(stderr, "Could not load font at %s!\n", filePath); } - return true; } -static void addFontFiles(const Vector<String>& fontFiles, FcConfig* config) +static CString getCustomBuildDir() { - for (Vector<String>::const_iterator it = fontFiles.begin(); it != fontFiles.end(); ++it) { - const CString currentFile = (*it).utf8(); - const char* path = currentFile.data(); + if (const char* userChosenBuildDir = getenv("WEBKITOUTPUTDIR")) { + if (ecore_file_is_dir(userChosenBuildDir)) + return userChosenBuildDir; + fprintf(stderr, "WEBKITOUTPUTDIR set to '%s', but path doesn't exist.\n", userChosenBuildDir); + } - if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(path))) - fprintf(stderr, "Could not load font at %s!\n", path); + return CString(); +} + +static CString getPlatformFontsPath() +{ + CString customBuildDir = getCustomBuildDir(); + if (!customBuildDir.isNull()) { + CString fontsPath = buildPath(customBuildDir.data(), "Dependencies", "Root", "webkitgtk-test-fonts", 0); + if (!ecore_file_exists(fontsPath.data())) + fprintf(stderr, "WEBKITOUTPUTDIR set to '%s', but could not local test fonts.\n", customBuildDir.data()); + return fontsPath; } + + CString fontsPath = CString(DOWNLOADED_FONTS_DIR); + if (ecore_file_exists(fontsPath.data())) + return fontsPath; + + fprintf(stderr, "Could not locate tests fonts, try setting WEBKITOUTPUTDIR.\n"); + return CString(); } void addFontsToEnvironment() @@ -89,14 +129,8 @@ void addFontsToEnvironment() exit(1); } - if (!addFontDirectory(DOWNLOADED_FONTS_DIR, config)) { - fprintf(stderr, "None of the font directories could be added. Either install them " - "or file a bug at http://bugs.webkit.org if they are installed in " - "another location.\n"); - exit(1); - } - - addFontFiles(getFontFiles(), config); + addFontFiles(getCoreFontFiles(), config); + addFontDirectory(getPlatformFontsPath(), config); if (!FcConfigSetCurrent(config)) { fprintf(stderr, "Could not set the current font configuration!\n"); diff --git a/Tools/DumpRenderTree/efl/ImageDiff.cpp b/Tools/DumpRenderTree/efl/ImageDiff.cpp index 88a0e4a1f..129b6ca57 100644 --- a/Tools/DumpRenderTree/efl/ImageDiff.cpp +++ b/Tools/DumpRenderTree/efl/ImageDiff.cpp @@ -45,6 +45,8 @@ #include <wtf/OwnArrayPtr.h> #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/efl/RefPtrEfl.h> enum PixelComponent { Red, @@ -106,7 +108,7 @@ static float calculatePixelDifference(unsigned char* basePixel, unsigned char* a return sqrtf(red * red + green * green + blue * blue + alpha * alpha) / 2.0f; } -static float calculateDifference(Evas_Object* baselineImage, Evas_Object* actualImage, OwnPtr<Evas_Object>& differenceImage) +static float calculateDifference(Evas_Object* baselineImage, Evas_Object* actualImage, RefPtr<Evas_Object>& differenceImage) { int width, height, baselineWidth, baselineHeight; evas_object_image_size_get(actualImage, &width, &height); @@ -163,7 +165,7 @@ static float calculateDifference(Evas_Object* baselineImage, Evas_Object* actual difference = roundf(difference * 100.0f) / 100.0f; difference = std::max(difference, 0.01f); // round to 2 decimal places - differenceImage = adoptPtr(differenceImageFromDifferenceBuffer(evas_object_evas_get(baselineImage), diffBuffer.get(), width, height)); + differenceImage = adoptRef(differenceImageFromDifferenceBuffer(evas_object_evas_get(baselineImage), diffBuffer.get(), width, height)); } return difference; @@ -226,7 +228,7 @@ static void printImage(Evas_Object* image) static void printImageDifferences(Evas_Object* baselineImage, Evas_Object* actualImage) { - OwnPtr<Evas_Object> differenceImage; + RefPtr<Evas_Object> differenceImage; const float difference = calculateDifference(baselineImage, actualImage, differenceImage); if (difference > 0.0f) { @@ -254,7 +256,7 @@ static void resizeEcoreEvasIfNeeded(Evas_Object* image) ecore_evas_resize(gEcoreEvas.get(), currentWidth, currentHeight); } -static PassOwnPtr<Evas_Object> readImageFromStdin(Evas* evas, long imageSize) +static PassRefPtr<Evas_Object> readImageFromStdin(Evas* evas, long imageSize) { OwnArrayPtr<unsigned char> imageBuffer = adoptArrayPtr(new unsigned char[imageSize]); if (!imageBuffer) @@ -262,7 +264,7 @@ static PassOwnPtr<Evas_Object> readImageFromStdin(Evas* evas, long imageSize) const size_t bytesRead = fread(imageBuffer.get(), 1, imageSize, stdin); if (!bytesRead) - return PassOwnPtr<Evas_Object>(); + return PassRefPtr<Evas_Object>(); Evas_Object* image = evas_object_image_filled_add(evas); evas_object_image_colorspace_set(image, EVAS_COLORSPACE_ARGB8888); @@ -270,7 +272,7 @@ static PassOwnPtr<Evas_Object> readImageFromStdin(Evas* evas, long imageSize) resizeEcoreEvasIfNeeded(image); - return adoptPtr(image); + return adoptRef(image); } static bool parseCommandLineOptions(int argc, char** argv) @@ -331,8 +333,8 @@ int main(int argc, char* argv[]) Evas* evas = initEfl(); - OwnPtr<Evas_Object> actualImage; - OwnPtr<Evas_Object> baselineImage; + RefPtr<Evas_Object> actualImage; + RefPtr<Evas_Object> baselineImage; char buffer[2048]; while (fgets(buffer, sizeof(buffer), stdin)) { diff --git a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp index 737f4342c..e43e7e075 100644 --- a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp +++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp @@ -119,8 +119,9 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { - notImplemented(); - return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("")); + String result = DumpRenderTreeSupportEfl::layerTreeAsText(browser->mainFrame()); + + return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString(result.utf8().data())); } size_t TestRunner::webHistoryItemCount() diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp index dabb09d29..eecade97c 100644 --- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -770,6 +770,7 @@ static void runTest(const string& inputLine) WebCoreTestSupport::resetInternalsObject(webkit_web_frame_get_global_context(mainFrame)); DumpRenderTreeSupportGtk::clearMemoryCache(); + DumpRenderTreeSupportGtk::clearApplicationCache(); // A blank load seems to be necessary to reset state after certain tests. webkit_web_view_open(webView, "about:blank"); diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index 03954b104..dd3a22275 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -47,7 +47,7 @@ SOURCES += \ GCControllerQt.cpp \ QtInitializeTestFonts.cpp \ testplugin.cpp \ - main.cpp + DumpRenderTreeMain.cpp wince*: { INCLUDEPATH += $$QT.core.sources/../3rdparty/ce-compat $$WCECOMPAT/include diff --git a/Tools/DumpRenderTree/qt/main.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp index f2469d213..f5e7fc159 100644 --- a/Tools/DumpRenderTree/qt/main.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp @@ -31,30 +31,30 @@ #include "QtInitializeTestFonts.h" -#include <wtf/AlwaysInline.h> - -#include <qstringlist.h> #include <qapplication.h> -#include <qurl.h> -#include <qdir.h> #include <qdebug.h> +#include <qdir.h> #include <qfont.h> -#include <qwebdatabase.h> +#include <qstringlist.h> #include <qtimer.h> +#include <qurl.h> +#include <qwebdatabase.h> #include <qwindowsstyle.h> +#include <wtf/AlwaysInline.h> +#include <wtf/ExportMacros.h> + #ifdef Q_WS_X11 #include <qx11info_x11.h> #endif #ifdef Q_OS_WIN -#include <io.h> #include <fcntl.h> +#include <io.h> #endif #include <limits.h> -#include <wtf/ExportMacros.h> #include <wtf/Assertions.h> void messageHandler(QtMsgType type, const char *message) diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index db09ad713..be984e3eb 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -197,7 +197,6 @@ void WebPage::resetSettings() m_drt->testRunner()->setCaretBrowsingEnabled(false); m_drt->testRunner()->setAuthorAndUserStylesEnabled(true); m_drt->testRunner()->setFrameFlatteningEnabled(false); - m_drt->testRunner()->setMockScrollbarsEnabled(false); m_drt->testRunner()->setSmartInsertDeleteEnabled(true); m_drt->testRunner()->setSelectTrailingWhitespaceEnabled(false); m_drt->testRunner()->setDefersLoading(false); diff --git a/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro index 92c768740..f7b638dfc 100644 --- a/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro +++ b/Tools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro @@ -50,8 +50,6 @@ mac { QMAKE_PLUGIN_BUNDLE_NAME = $$TARGET QMAKE_BUNDLE_LOCATION += "Contents/MacOS" - !build_pass:CONFIG += build_all - OBJECTIVE_SOURCES += PluginObjectMac.mm LIBS += -framework Carbon -framework Cocoa -framework QuartzCore } diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp index 4f8d07030..d3503bd1e 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp @@ -444,11 +444,6 @@ void TestRunner::setFrameFlatteningEnabled(bool enabled) DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled); } -void TestRunner::setMockScrollbarsEnabled(bool enabled) -{ - DumpRenderTreeSupportQt::setMockScrollbarsEnabled(m_drt->webPage(), enabled); -} - void TestRunner::goBack() { DumpRenderTreeSupportQt::goBack(m_drt->webPage()); diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.h b/Tools/DumpRenderTree/qt/TestRunnerQt.h index 486b9fdb6..88a9c6a94 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.h +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.h @@ -156,7 +156,6 @@ public Q_SLOTS: void removeAllVisitedLinks(); void setMediaType(const QString&); void setFrameFlatteningEnabled(bool); - void setMockScrollbarsEnabled(bool); void setAllowUniversalAccessFromFileURLs(bool enable); void setAllowFileAccessFromFileURLs(bool enable); void setAppCacheMaximumSize(unsigned long long quota); |