diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-16 14:56:46 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-16 14:57:30 +0200 |
commit | b297e0fa5c217c9467033b7c8b46891a52870120 (patch) | |
tree | 43fc14689295e9e64f2719d05aad94e3049f6cd7 /Tools/DumpRenderTree | |
parent | 69d517dbfa69903d8593cc1737f0474b21e3251e (diff) | |
download | qtwebkit-b297e0fa5c217c9467033b7c8b46891a52870120.tar.gz |
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78.
Caused OOM issues on some CI machines :(
Diffstat (limited to 'Tools/DumpRenderTree')
59 files changed, 271 insertions, 884 deletions
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp index 4145b9cc0..982c767fd 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp +++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp @@ -78,7 +78,6 @@ 'target_name': 'TestRunner', 'type': 'static_library', 'dependencies': [ - 'TestRunner_resources', '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit', '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf', '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', @@ -112,77 +111,13 @@ ], }, { - 'target_name': 'TestRunner_resources', - 'type': 'none', - 'dependencies': [ - 'ImageDiff', - 'copy_TestNetscapePlugIn', - ], - 'conditions': [ - ['OS=="win"', { - 'dependencies': [ - 'LayoutTestHelper', - ], - 'copies': [{ - 'destination': '<(PRODUCT_DIR)', - 'files': ['<(ahem_path)'], - }], - }], - ['OS=="mac"', { - 'dependencies': [ - 'LayoutTestHelper', - ], - 'mac_bundle_resources': [ - '<(ahem_path)', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf', - '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf', - '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png', - '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png', - ], - }], - ['use_x11 == 1', { - 'copies': [{ - 'destination': '<(PRODUCT_DIR)', - 'files': [ - '<(ahem_path)', - '<(tools_dir)/DumpRenderTree/chromium/fonts.conf', - ] - }], - }], - ['OS=="android"', { - 'dependencies!': [ - 'ImageDiff', - 'copy_TestNetscapePlugIn', - ], - 'copies': [{ - 'destination': '<(PRODUCT_DIR)', - 'files': [ - '<(ahem_path)', - '<(tools_dir)/DumpRenderTree/chromium/android_main_fonts.xml', - '<(tools_dir)/DumpRenderTree/chromium/android_fallback_fonts.xml', - ] - }], - }], - ['OS=="android" and android_build_type==0', { - 'dependencies': [ - 'ImageDiff#host', - ], - }], - ], - }, - { 'target_name': 'DumpRenderTree', 'type': 'executable', 'mac_bundle': 1, 'dependencies': [ + 'ImageDiff', 'TestRunner', + 'copy_TestNetscapePlugIn', '<(source_dir)/WebKit/chromium/WebKit.gyp:inspector_resources', '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit', '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf', @@ -191,6 +126,7 @@ '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc', '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa', '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob', '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', ], 'include_dirs': [ @@ -217,6 +153,7 @@ }], ['OS=="win"', { 'dependencies': [ + 'LayoutTestHelper', '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libEGL', '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libGLESv2', ], @@ -240,6 +177,10 @@ }, }], ], + 'copies': [{ + 'destination': '<(PRODUCT_DIR)', + 'files': ['<(ahem_path)'], + }], },{ # OS!="win" 'sources/': [ ['exclude', 'Win\\.cpp$'], @@ -271,6 +212,21 @@ ['OS=="mac"', { 'dependencies': [ '<(source_dir)/WebKit/chromium/WebKit.gyp:copy_mesa', + 'LayoutTestHelper', + ], + 'mac_bundle_resources': [ + '<(ahem_path)', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf', + '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf', + '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png', + '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png', ], },{ # OS!="mac" 'sources/': [ @@ -290,6 +246,8 @@ 'copies': [{ 'destination': '<(PRODUCT_DIR)', 'files': [ + '<(ahem_path)', + '<(tools_dir)/DumpRenderTree/chromium/fonts.conf', '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak', ] }], @@ -328,9 +286,17 @@ '<(chromium_src_dir)/tools/android/forwarder/forwarder.gyp:forwarder', '<(chromium_src_dir)/tools/android/md5sum/md5sum.gyp:md5sum', ], + 'dependencies!': [ + 'ImageDiff', + 'copy_TestNetscapePlugIn', + '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa', + ], 'copies': [{ 'destination': '<(PRODUCT_DIR)', 'files': [ + '<(ahem_path)', + '<(tools_dir)/DumpRenderTree/chromium/android_main_fonts.xml', + '<(tools_dir)/DumpRenderTree/chromium/android_fallback_fonts.xml', '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak', ] }], @@ -339,6 +305,11 @@ ['exclude', 'Android\\.cpp$'], ], }], + ['OS=="android" and android_build_type==0', { + 'dependencies': [ + 'ImageDiff#host', + ], + }], ['inside_chromium_build==1 and component=="shared_library"', { 'sources': [ '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp', diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi index 4562aaf73..832ffc991 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gypi +++ b/Tools/DumpRenderTree/DumpRenderTree.gypi @@ -8,8 +8,6 @@ 'chromium/DumpRenderTree.cpp', 'chromium/DRTTestRunner.cpp', 'chromium/DRTTestRunner.h', - 'chromium/MockConstraints.cpp', - 'chromium/MockConstraints.h', 'chromium/MockGrammarCheck.cpp', 'chromium/MockGrammarCheck.h', 'chromium/MockSpellCheck.cpp', @@ -58,8 +56,6 @@ 'chromium/WebViewHost.h', 'chromium/WebViewHostOutputSurface.cpp', 'chromium/WebViewHostOutputSurface.h', - 'chromium/WebViewHostSoftwareOutputDevice.cpp', - 'chromium/WebViewHostSoftwareOutputDevice.h', ], 'test_runner_files': [ 'DumpRenderTree.h', diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt b/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt index 65a7427cd..59492dd79 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt @@ -21,7 +21,6 @@ SET(WebKitTestNetscapePlugin_SOURCES ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/NullNPPGetValuePointer.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PassDifferentNPPStruct.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PluginScriptableNPObjectInvokeDefault.cpp - ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PluginScriptableObjectOverridesAllProperties.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/PrivateBrowsing.cpp ${WEBKIT_TESTNETSCAPEPLUGIN_DIR}/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp ) diff --git a/Tools/DumpRenderTree/TestRunner.cpp b/Tools/DumpRenderTree/TestRunner.cpp index fe28a2911..9f7a7c1be 100644 --- a/Tools/DumpRenderTree/TestRunner.cpp +++ b/Tools/DumpRenderTree/TestRunner.cpp @@ -699,6 +699,13 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context return controller->computedStyleIncludingVisitedInfo(context, arguments[0]); } +static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + // Has mac & windows implementation + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); + return JSValueMakeString(context, controller->layerTreeAsText().get()); +} + static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation @@ -1080,40 +1087,10 @@ static JSValueRef setMockGeolocationPositionCallback(JSContextRef context, JSObj if (argumentCount < 3) return JSValueMakeUndefined(context); - double latitude = JSValueToNumber(context, arguments[0], 0); - double longitude = JSValueToNumber(context, arguments[1], 0); - double accuracy = JSValueToNumber(context, arguments[2], 0); - - bool canProvideAltitude = false; - double altitude = 0.; - if (argumentCount > 3 && !JSValueIsUndefined(context, arguments[3])) { - canProvideAltitude = true; - altitude = JSValueToNumber(context, arguments[3], 0); - } - - bool canProvideAltitudeAccuracy = false; - double altitudeAccuracy = 0.; - if (argumentCount > 4 && !JSValueIsUndefined(context, arguments[4])) { - canProvideAltitudeAccuracy = true; - altitudeAccuracy = JSValueToNumber(context, arguments[4], 0); - } - - bool canProvideHeading = false; - double heading = 0.; - if (argumentCount > 5 && !JSValueIsUndefined(context, arguments[5])) { - canProvideHeading = true; - heading = JSValueToNumber(context, arguments[5], 0); - } - - bool canProvideSpeed = false; - double speed = 0.; - if (argumentCount > 6 && !JSValueIsUndefined(context, arguments[6])) { - canProvideSpeed = true; - speed = JSValueToNumber(context, arguments[6], 0); - } - TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); - controller->setMockGeolocationPosition(latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading, canProvideSpeed, speed); + controller->setMockGeolocationPosition(JSValueToNumber(context, arguments[0], NULL), // latitude + JSValueToNumber(context, arguments[1], NULL), // longitude + JSValueToNumber(context, arguments[2], NULL)); // accuracy return JSValueMakeUndefined(context); } @@ -2237,6 +2214,7 @@ JSStaticFunction* TestRunner::staticFunctions() { "ignoreLegacyWebNotificationPermissionRequests", ignoreLegacyWebNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, + { "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "numberOfPendingGeolocationPermissionRequests", numberOfPendingGeolocationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, diff --git a/Tools/DumpRenderTree/TestRunner.h b/Tools/DumpRenderTree/TestRunner.h index fa76c7642..edd0dfda7 100644 --- a/Tools/DumpRenderTree/TestRunner.h +++ b/Tools/DumpRenderTree/TestRunner.h @@ -100,7 +100,7 @@ public: void setAutomaticLinkDetectionEnabled(bool flag); void setMainFrameIsFirstResponder(bool flag); void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma); - void setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed); + void setMockGeolocationPosition(double latitude, double longitude, double accuracy); void setMockGeolocationPositionUnavailableError(JSStringRef message); void addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language); void setMockSpeechInputDumpRect(bool flag); @@ -336,6 +336,8 @@ public: // Simulate a request an embedding application could make, populating per-session credential storage. void authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password); + JSRetainPtr<JSStringRef> layerTreeAsText() const; + JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef, JSValueRef nodeObject) const; JSValueRef originsWithLocalStorage(JSContextRef); diff --git a/Tools/DumpRenderTree/blackberry/EventSender.cpp b/Tools/DumpRenderTree/blackberry/EventSender.cpp index ab7f808f8..5c30ea408 100644 --- a/Tools/DumpRenderTree/blackberry/EventSender.cpp +++ b/Tools/DumpRenderTree/blackberry/EventSender.cpp @@ -151,7 +151,6 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS static const JSStringRef lengthProperty = JSStringCreateWithUTF8CString("length"); bool needsAltKeyModifier = false; - bool needsCtrlKeyModifier = false; if (argumentCount > 1) { if (JSObjectRef modifiersArray = JSValueToObject(context, arguments[1], 0)) { int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, lengthProperty, 0), 0); @@ -161,8 +160,6 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS needsShiftKeyModifier = true; else if (JSStringIsEqualToUTF8CString(string, "altKey")) needsAltKeyModifier = true; - else if (JSStringIsEqualToUTF8CString(string, "ctrlKey")) - needsCtrlKeyModifier = true; JSStringRelease(string); } } @@ -175,8 +172,6 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS modifiers |= KEYMOD_SHIFT; if (needsAltKeyModifier) modifiers |= KEYMOD_ALT; - if (needsCtrlKeyModifier) - modifiers |= KEYMOD_CTRL; page->keyEvent(BlackBerry::Platform::KeyboardEvent(charCode, BlackBerry::Platform::KeyboardEvent::KeyChar, modifiers)); diff --git a/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp index c9d013775..62be5fe18 100644 --- a/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp +++ b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp @@ -437,8 +437,6 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value) DumpRenderTreeSupport::setLinksIncludedInFocusChain(valueStr == "true" || valueStr == "1"); else if (keyStr == "WebKitHyperlinkAuditingEnabled") mainFrame->page()->settings()->setHyperlinkAuditingEnabled(valueStr == "true" || valueStr == "1"); - else if (keyStr == "WebSocketsEnabled") - BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setWebSocketsEnabled(valueStr == "true" || valueStr == "1"); } void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) @@ -587,6 +585,12 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value); } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + notImplemented(); + return 0; +} + JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { WebCore::Element* element = toElement(toJS(toJS(context), nodeObject)); @@ -619,7 +623,7 @@ void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { - DumpRenderTreeSupport::setMockDeviceOrientation(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); + notImplemented(); } void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp index 8aee7c5b2..f4f3aed22 100644 --- a/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp @@ -166,6 +166,7 @@ DRTTestRunner::DRTTestRunner(TestShell* shell) bindMethod("findString", &DRTTestRunner::findString); bindMethod("isCommandEnabled", &DRTTestRunner::isCommandEnabled); bindMethod("hasCustomPageSizeStyle", &DRTTestRunner::hasCustomPageSizeStyle); + bindMethod("layerTreeAsText", &DRTTestRunner::layerTreeAsText); bindMethod("loseCompositorContext", &DRTTestRunner::loseCompositorContext); bindMethod("markerTextForListItem", &DRTTestRunner::markerTextForListItem); bindMethod("notifyDone", &DRTTestRunner::notifyDone); @@ -1903,6 +1904,11 @@ void DRTTestRunner::startSpeechInput(const CppArgumentList& arguments, CppVarian input->startSpeechInput(); } +void DRTTestRunner::layerTreeAsText(const CppArgumentList& args, CppVariant* result) +{ + result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8()); +} + void DRTTestRunner::loseCompositorContext(const CppArgumentList& args, CppVariant*) { int numTimes; diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h index 3041b86a7..55940acd1 100644 --- a/Tools/DumpRenderTree/chromium/DRTTestRunner.h +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h @@ -355,6 +355,8 @@ public: #endif void startSpeechInput(const CppArgumentList&, CppVariant*); + void layerTreeAsText(const CppArgumentList& args, CppVariant* result); + void loseCompositorContext(const CppArgumentList& args, CppVariant* result); void markerTextForListItem(const CppArgumentList&, CppVariant*); diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index 30ce28851..0949aa7a6 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -55,7 +55,6 @@ static const char optionStartupDialog[] = "--testshell-startup-dialog"; static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-deps"; static const char optionHardwareAcceleratedGL[] = "--enable-hardware-gpu"; -static const char optionEnableSoftwareCompositing[] = "--enable-software-compositing"; static const char optionEnableThreadedCompositing[] = "--enable-threaded-compositing"; static const char optionForceCompositingMode[] = "--force-compositing-mode"; static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas"; @@ -126,7 +125,6 @@ int main(int argc, char* argv[]) bool allowExternalPages = false; bool startupDialog = false; bool acceleratedCompositingForVideoEnabled = false; - bool softwareCompositingEnabled = false; bool threadedCompositingEnabled = false; bool forceCompositingMode = false; bool accelerated2DCanvasEnabled = false; @@ -161,8 +159,6 @@ int main(int argc, char* argv[]) hardwareAcceleratedGL = true; else if (argument == optionEnableAcceleratedCompositingForVideo) acceleratedCompositingForVideoEnabled = true; - else if (argument == optionEnableSoftwareCompositing) - softwareCompositingEnabled = true; else if (argument == optionEnableThreadedCompositing) threadedCompositingEnabled = true; else if (argument == optionForceCompositingMode) @@ -215,7 +211,6 @@ int main(int argc, char* argv[]) TestShell shell; shell.setAllowExternalPages(allowExternalPages); shell.setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); - shell.setSoftwareCompositingEnabled(softwareCompositingEnabled); shell.setThreadedCompositingEnabled(threadedCompositingEnabled); shell.setForceCompositingMode(forceCompositingMode); shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled); diff --git a/Tools/DumpRenderTree/chromium/MockConstraints.cpp b/Tools/DumpRenderTree/chromium/MockConstraints.cpp deleted file mode 100644 index a4f15842e..000000000 --- a/Tools/DumpRenderTree/chromium/MockConstraints.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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 "config.h" -#if ENABLE(MEDIA_STREAM) - -#include "MockConstraints.h" - -#include <public/WebMediaConstraints.h> - -using namespace WebKit; - -namespace MockConstraints { - -static bool isSupported(const WebString& constraint) -{ - return constraint == "valid_and_supported_1" || constraint == "valid_and_supported_2"; -} - -static bool isValid(const WebString& constraint) -{ - return isSupported(constraint) || constraint == "valid_but_unsupported_1" || constraint == "valid_but_unsupported_2"; -} - -bool verifyConstraints(const WebMediaConstraints& constraints) -{ - WebVector<WebMediaConstraint> mandatoryConstraints; - constraints.getMandatoryConstraints(mandatoryConstraints); - if (mandatoryConstraints.size()) { - for (size_t i = 0; i < mandatoryConstraints.size(); ++i) { - const WebMediaConstraint& curr = mandatoryConstraints[i]; - if (!isSupported(curr.m_name) || curr.m_value != "1") - return false; - } - } - - WebVector<WebMediaConstraint> optionalConstraints; - constraints.getOptionalConstraints(optionalConstraints); - if (optionalConstraints.size()) { - for (size_t i = 0; i < optionalConstraints.size(); ++i) { - const WebMediaConstraint& curr = optionalConstraints[i]; - if (!isValid(curr.m_name) || curr.m_value != "0") - return false; - } - } - - return true; -} - -} // namespace MockConstraints - -#endif // ENABLE(MEDIA_STREAM) diff --git a/Tools/DumpRenderTree/chromium/MockConstraints.h b/Tools/DumpRenderTree/chromium/MockConstraints.h deleted file mode 100644 index 6bf0da9b1..000000000 --- a/Tools/DumpRenderTree/chromium/MockConstraints.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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 MockConstraints_h -#define MockConstraints_h - -#if ENABLE(MEDIA_STREAM) - -namespace WebKit { -class WebMediaConstraints; -} - -namespace MockConstraints { - -bool verifyConstraints(const WebKit::WebMediaConstraints&); - -} // namespace MockConstraints - -#endif // ENABLE(MEDIA_STREAM) - -#endif // MockConstraints_h - diff --git a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp index 09f5c5d5e..b2d50feb3 100644 --- a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp +++ b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp @@ -33,23 +33,19 @@ #include "MockWebRTCPeerConnectionHandler.h" -#include "MockConstraints.h" #include <public/WebMediaConstraints.h> #include <public/WebRTCPeerConnectionHandlerClient.h> #include <public/WebRTCSessionDescription.h> #include <public/WebRTCSessionDescriptionRequest.h> -#include <public/WebRTCStatsRequest.h> -#include <public/WebRTCStatsResponse.h> #include <public/WebRTCVoidRequest.h> #include <public/WebString.h> #include <public/WebVector.h> -#include <wtf/DateMath.h> using namespace WebKit; class RTCSessionDescriptionRequestSuccededTask : public MethodTask<MockWebRTCPeerConnectionHandler> { public: - RTCSessionDescriptionRequestSuccededTask(MockWebRTCPeerConnectionHandler* object, const WebRTCSessionDescriptionRequest& request, const WebRTCSessionDescription& result) + RTCSessionDescriptionRequestSuccededTask(MockWebRTCPeerConnectionHandler* object, const WebKit::WebRTCSessionDescriptionRequest& request, const WebKit::WebRTCSessionDescription& result) : MethodTask<MockWebRTCPeerConnectionHandler>(object) , m_request(request) , m_result(result) @@ -62,13 +58,13 @@ public: } private: - WebRTCSessionDescriptionRequest m_request; - WebRTCSessionDescription m_result; + WebKit::WebRTCSessionDescriptionRequest m_request; + WebKit::WebRTCSessionDescription m_result; }; class RTCSessionDescriptionRequestFailedTask : public MethodTask<MockWebRTCPeerConnectionHandler> { public: - RTCSessionDescriptionRequestFailedTask(MockWebRTCPeerConnectionHandler* object, const WebRTCSessionDescriptionRequest& request) + RTCSessionDescriptionRequestFailedTask(MockWebRTCPeerConnectionHandler* object, const WebKit::WebRTCSessionDescriptionRequest& request) : MethodTask<MockWebRTCPeerConnectionHandler>(object) , m_request(request) { @@ -80,31 +76,12 @@ public: } private: - WebRTCSessionDescriptionRequest m_request; -}; - -class RTCStatsRequestSucceededTask : public MethodTask<MockWebRTCPeerConnectionHandler> { -public: - RTCStatsRequestSucceededTask(MockWebRTCPeerConnectionHandler* object, const WebKit::WebRTCStatsRequest& request, const WebKit::WebRTCStatsResponse& response) - : MethodTask<MockWebRTCPeerConnectionHandler>(object) - , m_request(request) - , m_response(response) - { - } - - virtual void runIfValid() OVERRIDE - { - m_request.requestSucceeded(m_response); - } - -private: - WebKit::WebRTCStatsRequest m_request; - WebKit::WebRTCStatsResponse m_response; + WebKit::WebRTCSessionDescriptionRequest m_request; }; class RTCVoidRequestTask : public MethodTask<MockWebRTCPeerConnectionHandler> { public: - RTCVoidRequestTask(MockWebRTCPeerConnectionHandler* object, const WebRTCVoidRequest& request, bool succeeded) + RTCVoidRequestTask(MockWebRTCPeerConnectionHandler* object, const WebKit::WebRTCVoidRequest& request, bool succeeded) : MethodTask<MockWebRTCPeerConnectionHandler>(object) , m_request(request) , m_succeeded(succeeded) @@ -120,7 +97,7 @@ public: } private: - WebRTCVoidRequest m_request; + WebKit::WebRTCVoidRequest m_request; bool m_succeeded; }; @@ -128,13 +105,48 @@ private: MockWebRTCPeerConnectionHandler::MockWebRTCPeerConnectionHandler(WebRTCPeerConnectionHandlerClient* client) : m_client(client) - , m_streamCount(0) { } +static bool isSupportedConstraint(const WebString& constraint) +{ + return constraint == "valid_and_supported_1" || constraint == "valid_and_supported_2"; +} + +static bool isValidConstraint(const WebString& constraint) +{ + return isSupportedConstraint(constraint) || constraint == "valid_but_unsupported_1" || constraint == "valid_but_unsupported_2"; +} + bool MockWebRTCPeerConnectionHandler::initialize(const WebRTCConfiguration&, const WebMediaConstraints& constraints) { - return MockConstraints::verifyConstraints(constraints); + WebVector<WebString> mandatoryConstraintNames; + constraints.getMandatoryConstraintNames(mandatoryConstraintNames); + if (mandatoryConstraintNames.size()) { + for (size_t i = 0; i < mandatoryConstraintNames.size(); ++i) { + if (!isSupportedConstraint(mandatoryConstraintNames[i])) + return false; + WebString value; + constraints.getMandatoryConstraintValue(mandatoryConstraintNames[i], value); + if (value != "1") + return false; + } + } + + WebVector<WebString> optionalConstraintNames; + constraints.getOptionalConstraintNames(optionalConstraintNames); + if (optionalConstraintNames.size()) { + for (size_t i = 0; i < optionalConstraintNames.size(); ++i) { + if (!isValidConstraint(optionalConstraintNames[i])) + return false; + WebString value; + constraints.getOptionalConstraintValue(optionalConstraintNames[i], value); + if (value != "0") + return false; + } + } + + return true; } void MockWebRTCPeerConnectionHandler::createOffer(const WebRTCSessionDescriptionRequest& request, const WebMediaConstraints& constraints) @@ -200,7 +212,6 @@ bool MockWebRTCPeerConnectionHandler::addICECandidate(const WebRTCICECandidate& bool MockWebRTCPeerConnectionHandler::addStream(const WebMediaStreamDescriptor& stream, const WebMediaConstraints&) { - m_streamCount += 1; m_client->didAddRemoteStream(stream); m_client->negotiationNeeded(); return true; @@ -208,26 +219,10 @@ bool MockWebRTCPeerConnectionHandler::addStream(const WebMediaStreamDescriptor& void MockWebRTCPeerConnectionHandler::removeStream(const WebMediaStreamDescriptor& stream) { - m_streamCount -= 1; m_client->didRemoveRemoteStream(stream); m_client->negotiationNeeded(); } -void MockWebRTCPeerConnectionHandler::getStats(const WebRTCStatsRequest& request) -{ - WebRTCStatsResponse response = request.createResponse(); - double currentDate = WTF::jsCurrentTime(); - for (int i = 0; i < m_streamCount; ++i) { - size_t reportIndex = response.addReport(); - response.addElement(reportIndex, true, currentDate); - response.addStatistic(reportIndex, true, "type", "audio"); - reportIndex = response.addReport(); - response.addElement(reportIndex, true, currentDate); - response.addStatistic(reportIndex, true, "type", "video"); - } - postTask(new RTCStatsRequestSucceededTask(this, request, response)); -} - void MockWebRTCPeerConnectionHandler::stop() { } diff --git a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h index 43d087e35..2bf139afa 100644 --- a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h +++ b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.h @@ -37,7 +37,6 @@ #include <public/WebRTCPeerConnectionHandler.h> #include <public/WebRTCSessionDescription.h> #include <public/WebRTCSessionDescriptionRequest.h> -#include <public/WebRTCStatsRequest.h> namespace WebKit { class WebRTCPeerConnectionHandlerClient; @@ -59,7 +58,6 @@ public: virtual bool addICECandidate(const WebKit::WebRTCICECandidate&) OVERRIDE; virtual bool addStream(const WebKit::WebMediaStreamDescriptor&, const WebKit::WebMediaConstraints&) OVERRIDE; virtual void removeStream(const WebKit::WebMediaStreamDescriptor&) OVERRIDE; - virtual void getStats(const WebKit::WebRTCStatsRequest&) OVERRIDE; virtual void stop() OVERRIDE; // Task related methods @@ -72,7 +70,6 @@ private: TaskList m_taskList; WebKit::WebRTCSessionDescription m_localDescription; WebKit::WebRTCSessionDescription m_remoteDescription; - int m_streamCount; }; #endif // ENABLE(MEDIA_STREAM) diff --git a/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp b/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp index 13c8ff1ec..716222f9a 100644 --- a/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp +++ b/Tools/DumpRenderTree/chromium/MockWebSpeechInputController.cpp @@ -52,7 +52,7 @@ void MockWebSpeechInputController::addMockRecognitionResult(const WebString& res String langString = String::fromUTF8(language.utf8().data()); if (!m_recognitionResults.contains(langString)) m_recognitionResults.set(langString, Vector<WebSpeechInputResult>()); - m_recognitionResults.find(langString)->value.append(res); + m_recognitionResults.find(langString)->second.append(res); } } diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp b/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp index a21588f74..0c5400f5e 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp @@ -75,7 +75,7 @@ bool NotificationPresenter::simulateClick(const WebString& title) if (m_activeNotifications.find(id) == m_activeNotifications.end()) return false; - const WebNotification& notification = m_activeNotifications.find(id)->value; + const WebNotification& notification = m_activeNotifications.find(id)->second; WebNotification eventTarget(notification); eventTarget.dispatchClickEvent(); return true; @@ -89,7 +89,7 @@ bool NotificationPresenter::show(const WebNotification& notification) WTF::String replaceId(notification.replaceId().data(), notification.replaceId().length()); if (m_replacements.find(replaceId) != m_replacements.end()) printf("REPLACING NOTIFICATION %s\n", - m_replacements.find(replaceId)->value.utf8().data()); + m_replacements.find(replaceId)->second.utf8().data()); m_replacements.set(replaceId, WTF::String(identifier.data(), identifier.length())); } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp index d60822be8..b795aeb83 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/AccessibilityUIElementChromium.cpp @@ -221,48 +221,8 @@ static string roleToString(WebAccessibilityRole role) return result.append("HorizontalRule"); case WebAccessibilityRoleLegend: return result.append("Legend"); - case WebAccessibilityRoleApplicationAlert: - return result.append("Alert"); - case WebAccessibilityRoleApplicationAlertDialog: - return result.append("AlertDialog"); - case WebAccessibilityRoleApplicationDialog: - return result.append("ApplicationDialog"); - case WebAccessibilityRoleDirectory: - return result.append("Directory"); - case WebAccessibilityRoleDocumentMath: - return result.append("Math"); - case WebAccessibilityRoleEditableText: - return result.append("EditableText"); - case WebAccessibilityRoleFooter: - return result.append("Footer"); - case WebAccessibilityRoleIgnored: - return result.append("Ignored"); - case WebAccessibilityRoleListItem: - return result.append("ListItem"); - case WebAccessibilityRoleMenuListPopup: - return result.append("MenuListPopup"); - case WebAccessibilityRoleMenuListOption: - return result.append("MenuListOption"); - case WebAccessibilityRolePresentational: - return result.append("Presentational"); - case WebAccessibilityRoleSpinButton: - return result.append("SpinButton"); - case WebAccessibilityRoleSpinButtonPart: - return result.append("SpinButtonPart"); - case WebAccessibilityRoleTabList: - return result.append("TabList"); - case WebAccessibilityRoleTabPanel: - return result.append("TabPanel"); - case WebAccessibilityRoleTab: - return result.append("Tab"); - case WebAccessibilityRoleTreeRole: - return result.append("Tree"); - case WebAccessibilityRoleTreeGrid: - return result.append("TreeGrid"); - case WebAccessibilityRoleTreeItemRole: - return result.append("TreeItem"); - case WebAccessibilityRoleUnknown: default: + // Also matches WebAccessibilityRoleUnknown. return result.append("Unknown"); } } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp b/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp index 1b29d2b0f..9b4a3b646 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/CppBoundClass.cpp @@ -203,10 +203,10 @@ bool CppNPObject::setProperty(NPObject* npObj, NPIdentifier ident, const NPVaria CppBoundClass::~CppBoundClass() { for (MethodList::iterator i = m_methods.begin(); i != m_methods.end(); ++i) - delete i->value; + delete i->second; for (PropertyList::iterator i = m_properties.begin(); i != m_properties.end(); ++i) - delete i->value; + delete i->second; // Unregister ourselves if we were bound to a frame. if (m_boundToFrame) @@ -237,7 +237,7 @@ bool CppBoundClass::invoke(NPIdentifier ident, } callback = m_fallbackCallback.get(); } else - callback = (*method).value; + callback = (*method).second; // Build a CppArgumentList argument vector from the NPVariants coming in. CppArgumentList cppArguments(argumentCount); @@ -260,7 +260,7 @@ bool CppBoundClass::getProperty(NPIdentifier ident, NPVariant* result) const } CppVariant cppValue; - if (!callback->value->getValue(&cppValue)) + if (!callback->second->getValue(&cppValue)) return false; cppValue.copyToNPVariant(result); return true; @@ -274,7 +274,7 @@ bool CppBoundClass::setProperty(NPIdentifier ident, const NPVariant* value) CppVariant cppValue; cppValue.set(*value); - return (*callback).value->setValue(cppValue); + return (*callback).second->setValue(cppValue); } void CppBoundClass::bindCallback(const string& name, Callback* callback) @@ -282,7 +282,7 @@ void CppBoundClass::bindCallback(const string& name, Callback* callback) NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str()); MethodList::iterator oldCallback = m_methods.find(ident); if (oldCallback != m_methods.end()) { - delete oldCallback->value; + delete oldCallback->second; if (!callback) { m_methods.remove(oldCallback); return; @@ -309,7 +309,7 @@ void CppBoundClass::bindProperty(const string& name, PropertyCallback* callback) NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str()); PropertyList::iterator oldCallback = m_properties.find(ident); if (oldCallback != m_properties.end()) { - delete oldCallback->value; + delete oldCallback->second; if (!callback) { m_properties.remove(oldCallback); return; diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index 32585faa1..e5e9ded6a 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -108,7 +108,6 @@ TestShell::TestShell() , m_dumpPixelsForCurrentTest(false) , m_allowExternalPages(false) , m_acceleratedCompositingForVideoEnabled(false) - , m_softwareCompositingEnabled(false) , m_threadedCompositingEnabled(false) , m_forceCompositingMode(false) , m_accelerated2dCanvasEnabled(false) @@ -400,7 +399,7 @@ static string dumpFramesAsText(WebFrame* frame, bool recursive) // Add header for all but the main frame. Skip empty frames. if (frame->parent() && !frame->document().documentElement().isNull()) { result.append("\n--------\nFrame: '"); - result.append(frame->uniqueName().utf8().data()); + result.append(frame->name().utf8().data()); result.append("'\n--------\n"); } @@ -426,7 +425,7 @@ static string dumpFramesAsPrintedText(WebFrame* frame, bool recursive) // Add header for all but the main frame. Skip empty frames. if (frame->parent() && !frame->document().documentElement().isNull()) { result.append("\n--------\nFrame: '"); - result.append(frame->uniqueName().utf8().data()); + result.append(frame->name().utf8().data()); result.append("'\n--------\n"); } @@ -446,7 +445,7 @@ static void dumpFrameScrollPosition(WebFrame* frame, bool recursive) WebSize offset = frame->scrollOffset(); if (offset.width > 0 || offset.height > 0) { if (frame->parent()) - printf("frame '%s' ", frame->uniqueName().utf8().data()); + printf("frame '%s' ", frame->name().utf8().data()); printf("scrolled to %d,%d\n", offset.width, offset.height); } diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 44b5ae388..405034a4e 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -130,8 +130,6 @@ public: void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } void setAcceleratedCompositingForVideoEnabled(bool enabled) { m_acceleratedCompositingForVideoEnabled = enabled; } - bool softwareCompositingEnabled() { return m_softwareCompositingEnabled; } - void setSoftwareCompositingEnabled(bool enabled) { m_softwareCompositingEnabled = enabled; } void setThreadedCompositingEnabled(bool enabled) { m_threadedCompositingEnabled = enabled; } void setForceCompositingMode(bool enabled) { m_forceCompositingMode = enabled; } void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; } @@ -228,7 +226,6 @@ private: int m_timeout; // timeout value in millisecond bool m_allowExternalPages; bool m_acceleratedCompositingForVideoEnabled; - bool m_softwareCompositingEnabled; bool m_threadedCompositingEnabled; bool m_forceCompositingMode; bool m_accelerated2dCanvasEnabled; diff --git a/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp b/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp index c54ebedea..c78c9ed12 100644 --- a/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp +++ b/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp @@ -33,7 +33,6 @@ #include "platform/WebKitPlatformSupport.h" #include "WebPluginContainer.h" #include "WebPluginParams.h" -#include "WebTouchPoint.h" #include <wtf/Assertions.h> #include <wtf/text/CString.h> @@ -77,61 +76,16 @@ static void premultiplyAlpha(const unsigned colorIn[3], float alpha, float color colorOut[3] = alpha; } -static const char* pointState(WebKit::WebTouchPoint::State state) -{ - switch (state) { - case WebKit::WebTouchPoint::StateReleased: - return "Released"; - case WebKit::WebTouchPoint::StatePressed: - return "Pressed"; - case WebKit::WebTouchPoint::StateMoved: - return "Moved"; - case WebKit::WebTouchPoint::StateCancelled: - return "Cancelled"; - default: - return "Unknown"; - } - - ASSERT_NOT_REACHED(); - return 0; -} - -static void printTouchList(const WebKit::WebTouchPoint* points, int length) -{ - for (int i = 0; i < length; ++i) - printf("* %d, %d: %s\n", points[i].position.x, points[i].position.y, pointState(points[i].state)); -} - -static void printEventDetails(const WebKit::WebInputEvent& event) -{ - if (WebKit::WebInputEvent::isTouchEventType(event.type)) { - const WebKit::WebTouchEvent& touch = static_cast<const WebKit::WebTouchEvent&>(event); - printTouchList(touch.touches, touch.touchesLength); - printTouchList(touch.changedTouches, touch.changedTouchesLength); - printTouchList(touch.targetTouches, touch.targetTouchesLength); - } else if (WebKit::WebInputEvent::isMouseEventType(event.type) || event.type == WebKit::WebInputEvent::MouseWheel) { - const WebKit::WebMouseEvent& mouse = static_cast<const WebKit::WebMouseEvent&>(event); - printf("* %d, %d\n", mouse.x, mouse.y); - } else if (WebKit::WebInputEvent::isGestureEventType(event.type)) { - const WebKit::WebGestureEvent& gesture = static_cast<const WebKit::WebGestureEvent&>(event); - printf("* %d, %d\n", gesture.x, gesture.y); - } -} - TestWebPlugin::TestWebPlugin(WebKit::WebFrame* frame, const WebKit::WebPluginParams& params) : m_frame(frame) , m_container(0) , m_context(0) - , m_acceptsTouchEvent(false) - , m_printEventDetails(false) { static const WebString kAttributePrimitive = WebString::fromUTF8("primitive"); static const WebString kAttributeBackgroundColor = WebString::fromUTF8("background-color"); static const WebString kAttributePrimitiveColor = WebString::fromUTF8("primitive-color"); static const WebString kAttributeOpacity = WebString::fromUTF8("opacity"); - static const WebString kAttributeAcceptsTouch = WebString::fromUTF8("accepts-touch"); - static const WebString kAttributePrintEventDetails = WebString::fromUTF8("print-event-details"); ASSERT(params.attributeNames.size() == params.attributeValues.size()); size_t size = params.attributeNames.size(); @@ -147,10 +101,6 @@ TestWebPlugin::TestWebPlugin(WebKit::WebFrame* frame, parseColor(attributeValue, m_scene.primitiveColor); else if (attributeName == kAttributeOpacity) m_scene.opacity = parseOpacity(attributeValue); - else if (attributeName == kAttributeAcceptsTouch) - m_acceptsTouchEvent = parseBoolean(attributeValue); - else if (attributeName == kAttributePrintEventDetails) - m_printEventDetails = parseBoolean(attributeValue); } } @@ -179,7 +129,6 @@ bool TestWebPlugin::initialize(WebPluginContainer* container) m_container = container; m_container->setBackingTextureId(m_colorTexture); - m_container->setIsAcceptingTouchEvents(m_acceptsTouchEvent); return true; } @@ -259,12 +208,6 @@ float TestWebPlugin::parseOpacity(const WebString& string) return static_cast<float>(atof(string.utf8().data())); } -bool TestWebPlugin::parseBoolean(const WebString& string) -{ - static const WebString kPrimitiveTrue = WebString::fromUTF8("true"); - return string == kPrimitiveTrue; -} - bool TestWebPlugin::initScene() { float color[4]; @@ -464,31 +407,6 @@ bool TestWebPlugin::handleInputEvent(const WebKit::WebInputEvent& event, WebKit: } printf("Plugin received event: %s\n", eventName ? eventName : "unknown"); - if (m_printEventDetails) - printEventDetails(event); - return false; -} - -bool TestWebPlugin::handleDragStatusUpdate(WebKit::WebDragStatus dragStatus, const WebKit::WebDragData&, WebKit::WebDragOperationsMask, const WebKit::WebPoint& position, const WebKit::WebPoint& screenPosition) -{ - const char* dragStatusName = 0; - switch (dragStatus) { - case WebKit::WebDragStatusEnter: - dragStatusName = "DragEnter"; - break; - case WebKit::WebDragStatusOver: - dragStatusName = "DragOver"; - break; - case WebKit::WebDragStatusLeave: - dragStatusName = "DragLeave"; - break; - case WebKit::WebDragStatusDrop: - dragStatusName = "DragDrop"; - break; - case WebKit::WebDragStatusUnknown: - ASSERT_NOT_REACHED(); - } - printf("Plugin received event: %s\n", dragStatusName); return false; } diff --git a/Tools/DumpRenderTree/chromium/TestWebPlugin.h b/Tools/DumpRenderTree/chromium/TestWebPlugin.h index aa6533e32..025b11095 100644 --- a/Tools/DumpRenderTree/chromium/TestWebPlugin.h +++ b/Tools/DumpRenderTree/chromium/TestWebPlugin.h @@ -42,9 +42,6 @@ class WebGraphicsContext3D; // background-color: black (default), red, green, blue. // primitive-color: black (default), red, green, blue. // opacity: [0.0 - 1.0]. Default is 1.0. -// -// Whether the plugin accepts touch events or not can be customized using the -// 'accepts-touch' plugin parameter (defaults to false). class TestWebPlugin : public WebKit::WebPlugin { public: TestWebPlugin(WebKit::WebFrame*, const WebKit::WebPluginParams&); @@ -65,7 +62,6 @@ public: virtual void updateVisibility(bool) { } virtual bool acceptsInputEvents() { return true; } virtual bool handleInputEvent(const WebKit::WebInputEvent&, WebKit::WebCursorInfo&); - virtual bool handleDragStatusUpdate(WebKit::WebDragStatus, const WebKit::WebDragData&, WebKit::WebDragOperationsMask, const WebKit::WebPoint& position, const WebKit::WebPoint& screenPosition); virtual void didReceiveResponse(const WebKit::WebURLResponse&) { } virtual void didReceiveData(const char* data, int dataLength) { } virtual void didFinishLoading() { } @@ -108,7 +104,6 @@ private: Primitive parsePrimitive(const WebKit::WebString&); void parseColor(const WebKit::WebString&, unsigned color[3]); float parseOpacity(const WebKit::WebString&); - bool parseBoolean(const WebKit::WebString&); // Functions for loading and drawing scene. bool initScene(); @@ -129,9 +124,6 @@ private: unsigned m_colorTexture; unsigned m_framebuffer; Scene m_scene; - - bool m_acceptsTouchEvent; - bool m_printEventDetails; }; #endif // TestPepperPlugin_h diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp index 3bc2cdd9f..5eebf596d 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp @@ -156,9 +156,9 @@ typedef void (*SetFontFamilyWrapper)(WebSettings*, const WebString&, UScriptCode static void applyFontMap(WebSettings* settings, const WebPreferences::ScriptFontFamilyMap& map, SetFontFamilyWrapper setter) { for (WebPreferences::ScriptFontFamilyMap::const_iterator iter = map.begin(); iter != map.end(); ++iter) { - const WebString& font = iter->value; + const WebString& font = iter->second; if (!font.isNull() && !font.isEmpty()) - (*setter)(settings, font, static_cast<UScriptCode>(iter->key)); + (*setter)(settings, font, static_cast<UScriptCode>(iter->first)); } } diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp index ed13ffa58..a373c3b30 100644 --- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp +++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp @@ -33,41 +33,15 @@ #include "WebUserMediaClientMock.h" -#include "MockConstraints.h" #include "WebDocument.h" #include "WebMediaStreamRegistry.h" #include "WebUserMediaRequest.h" -#include <public/WebMediaConstraints.h> -#include <public/WebMediaStreamDescriptor.h> -#include <public/WebMediaStreamSource.h> -#include <public/WebVector.h> +#include "platform/WebMediaStreamDescriptor.h" +#include "platform/WebMediaStreamSource.h" +#include "platform/WebVector.h" #include <wtf/Assertions.h> -using namespace WebKit; - -class UserMediaRequestTask : public MethodTask<WebUserMediaClientMock> { -public: - UserMediaRequestTask(WebUserMediaClientMock* object, const WebUserMediaRequest& request, const WebMediaStreamDescriptor result) - : MethodTask<WebUserMediaClientMock>(object) - , m_request(request) - , m_result(result) - { - } - - virtual void runIfValid() OVERRIDE - { - if (m_result.isNull()) - m_request.requestFailed(); - else - m_request.requestSucceeded(m_result); - } - -private: - WebUserMediaRequest m_request; - WebMediaStreamDescriptor m_result; -}; - -//////////////////////////////// +namespace WebKit { class MockExtraData : public WebMediaStreamDescriptor::ExtraData { public: @@ -85,18 +59,7 @@ void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamR WebUserMediaRequest request = streamRequest; if (request.ownerDocument().isNull() || !request.ownerDocument().frame()) { - postTask(new UserMediaRequestTask(this, request, WebMediaStreamDescriptor())); - return; - } - - WebMediaConstraints constraints = request.audioConstraints(); - if (!constraints.isNull() && !MockConstraints::verifyConstraints(constraints)) { - postTask(new UserMediaRequestTask(this, request, WebMediaStreamDescriptor())); - return; - } - constraints = request.videoConstraints(); - if (!constraints.isNull() && !MockConstraints::verifyConstraints(constraints)) { - postTask(new UserMediaRequestTask(this, request, WebMediaStreamDescriptor())); + request.requestFailed(); return; } @@ -111,16 +74,18 @@ void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamR if (request.video()) videoSources[0].initialize("MockVideoDevice#1", WebMediaStreamSource::TypeVideo, "Mock video device"); - WebMediaStreamDescriptor stream; - stream.initialize("foobar", audioSources, videoSources); + WebKit::WebMediaStreamDescriptor descriptor; + descriptor.initialize("foobar", audioSources, videoSources); - stream.setExtraData(new MockExtraData()); + descriptor.setExtraData(new MockExtraData()); - postTask(new UserMediaRequestTask(this, request, stream)); + request.requestSucceeded(descriptor); } void WebUserMediaClientMock::cancelUserMediaRequest(const WebUserMediaRequest&) { } +} // namespace WebKit + #endif // ENABLE(MEDIA_STREAM) diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h index 9e1beba4a..e2415985c 100644 --- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h +++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h @@ -33,31 +33,29 @@ #if ENABLE(MEDIA_STREAM) -#include "Task.h" #include "WebUserMediaClient.h" +#include "platform/WebCommon.h" +#include "platform/WebString.h" +#include "platform/WebURL.h" #include "webkit/support/test_media_stream_client.h" -#include <public/WebCommon.h> -#include <public/WebString.h> -#include <public/WebURL.h> #include <wtf/PassOwnPtr.h> -class WebUserMediaClientMock : public WebKit::WebUserMediaClient { +namespace WebKit { + +class WebUserMediaClientMock : public WebUserMediaClient { public: static PassOwnPtr<WebUserMediaClientMock> create(); ~WebUserMediaClientMock() { } - virtual void requestUserMedia(const WebKit::WebUserMediaRequest&, const WebKit::WebVector<WebKit::WebMediaStreamSource>&, const WebKit::WebVector<WebKit::WebMediaStreamSource>&) OVERRIDE; - virtual void cancelUserMediaRequest(const WebKit::WebUserMediaRequest&); - - // Task related methods - TaskList* taskList() { return &m_taskList; } + virtual void requestUserMedia(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&, const WebVector<WebMediaStreamSource>&) OVERRIDE; + virtual void cancelUserMediaRequest(const WebUserMediaRequest&); private: WebUserMediaClientMock() { } - - TaskList m_taskList; }; +} // namespace WebKit + #endif // ENABLE(MEDIA_STREAM) #endif // WebUserMediaClientMock_h diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index c7ab475e7..f8d804e96 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -65,7 +65,6 @@ #include "WebUserMediaClientMock.h" #include "WebView.h" #include "WebViewHostOutputSurface.h" -#include "WebViewHostSoftwareOutputDevice.h" #include "WebWindowFeatures.h" #include "platform/WebSerializedScriptValue.h" #include "skia/ext/platform_canvas.h" @@ -289,14 +288,11 @@ WebStorageNamespace* WebViewHost::createSessionStorageNamespace(unsigned quota) return webkit_support::CreateSessionStorageNamespace(quota); } -WebCompositorOutputSurface* WebViewHost::createOutputSurface() +WebKit::WebCompositorOutputSurface* WebViewHost::createOutputSurface() { if (!webView()) return 0; - - if (m_shell->softwareCompositingEnabled()) - return WebViewHostOutputSurface::createSoftware(adoptPtr(new WebViewHostSoftwareOutputDevice)).leakPtr(); - return WebViewHostOutputSurface::create3d(adoptPtr(webkit_support::CreateGraphicsContext3D(WebGraphicsContext3D::Attributes(), webView()))).leakPtr(); + return new WebKit::WebViewHostOutputSurface(adoptPtr(webkit_support::CreateGraphicsContext3D(WebKit::WebGraphicsContext3D::Attributes(), webView()))); } void WebViewHost::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine) @@ -1100,7 +1096,7 @@ void WebViewHost::unableToImplementPolicyWithError(WebFrame* frame, const WebURL { printf("Policy delegate: unable to implement policy with error domain '%s', " "error code %d, in frame '%s'\n", - error.domain.utf8().data(), error.reason, frame->uniqueName().utf8().data()); + error.domain.utf8().data(), error.reason, frame->name().utf8().data()); } void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to, @@ -1403,7 +1399,7 @@ void WebViewHost::deleteFileSystem(WebKit::WebFrame* frame, WebKit::WebFileSyste webkit_support::DeleteFileSystem(frame, type, callbacks); } -bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* sourceFrame, WebFrame* targetFrame, WebSecurityOrigin target, WebDOMMessageEvent event) +bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurityOrigin target, WebDOMMessageEvent event) { if (m_shell->testRunner()->shouldInterceptPostMessage()) { fputs("intercepted postMessage\n", stdout); @@ -1749,7 +1745,7 @@ void WebViewHost::updateSessionHistory(WebFrame* frame) void WebViewHost::printFrameDescription(WebFrame* webframe) { - string name8 = webframe->uniqueName().utf8(); + string name8 = webframe->name().utf8(); if (webframe == webView()->mainFrame()) { if (!name8.length()) { fputs("main frame", stdout); @@ -1774,7 +1770,7 @@ void WebViewHost::printFrameUserGestureStatus(WebFrame* webframe, const char* ms void WebViewHost::printResourceDescription(unsigned identifier) { ResourceMap::iterator it = m_resourceIdentifierMap.find(identifier); - printf("%s", it != m_resourceIdentifierMap.end() ? it->value.c_str() : "<unknown>"); + printf("%s", it != m_resourceIdentifierMap.end() ? it->second.c_str() : "<unknown>"); } void WebViewHost::setPendingExtraData(PassOwnPtr<TestShellExtraData> extraData) diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index c9e17b07f..4a3627f90 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -52,7 +52,6 @@ class MockWebSpeechInputController; class MockWebSpeechRecognizer; class SkCanvas; class TestShell; -class WebUserMediaClientMock; namespace WebKit { class WebFrame; @@ -67,6 +66,7 @@ class WebSharedWorkerClient; class WebSpeechInputController; class WebSpeechInputListener; class WebURL; +class WebUserMediaClientMock; struct WebRect; struct WebURLError; struct WebWindowFeatures; @@ -268,9 +268,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage); virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*); virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*); - virtual bool willCheckAndDispatchMessageEvent( - WebKit::WebFrame* sourceFrame, WebKit::WebFrame* targetFrame, - WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent); + virtual bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent); virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&); virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&); virtual void deliveredIntentResult(WebKit::WebFrame*, int, const WebKit::WebSerializedScriptValue&); @@ -345,7 +343,7 @@ private: void discardBackingStore(); #if ENABLE(MEDIA_STREAM) - WebUserMediaClientMock* userMediaClientMock(); + WebKit::WebUserMediaClientMock* userMediaClientMock(); webkit_support::TestMediaStreamClient* testMediaStreamClient(); #endif @@ -432,7 +430,7 @@ private: #endif #if ENABLE(MEDIA_STREAM) - OwnPtr<WebUserMediaClientMock> m_userMediaClientMock; + OwnPtr<WebKit::WebUserMediaClientMock> m_userMediaClientMock; OwnPtr<webkit_support::TestMediaStreamClient> m_testMediaStreamClient; #endif diff --git a/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.cpp b/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.cpp index 09a0af501..1d1b5840e 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.cpp @@ -27,41 +27,22 @@ #include "WebViewHostOutputSurface.h" -#include <public/WebCompositorSoftwareOutputDevice.h> #include <public/WebGraphicsContext3D.h> #include <wtf/Assertions.h> namespace WebKit { -PassOwnPtr<WebViewHostOutputSurface> WebViewHostOutputSurface::create3d(PassOwnPtr<WebKit::WebGraphicsContext3D> context3d) -{ - return adoptPtr(new WebViewHostOutputSurface(context3d)); -} - -PassOwnPtr<WebViewHostOutputSurface> WebViewHostOutputSurface::createSoftware(PassOwnPtr<WebKit::WebCompositorSoftwareOutputDevice> softwareDevice) -{ - return adoptPtr(new WebViewHostOutputSurface(softwareDevice)); -} - WebViewHostOutputSurface::WebViewHostOutputSurface(PassOwnPtr<WebKit::WebGraphicsContext3D> context) : m_context(context) { } -WebViewHostOutputSurface::WebViewHostOutputSurface(PassOwnPtr<WebKit::WebCompositorSoftwareOutputDevice> softwareDevice) - : m_softwareDevice(softwareDevice) -{ -} - WebViewHostOutputSurface::~WebViewHostOutputSurface() { } bool WebViewHostOutputSurface::bindToClient(WebCompositorOutputSurfaceClient*) { - if (!m_context) - return true; - return m_context->makeContextCurrent(); } @@ -75,11 +56,6 @@ WebGraphicsContext3D* WebViewHostOutputSurface::context3D() const return m_context.get(); } -WebCompositorSoftwareOutputDevice* WebViewHostOutputSurface::softwareDevice() const -{ - return m_softwareDevice.get(); -} - void WebViewHostOutputSurface::sendFrameToParentCompositor(const WebCompositorFrame&) { ASSERT_NOT_REACHED(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.h b/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.h index bbd61a21a..412bc539d 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.h +++ b/Tools/DumpRenderTree/chromium/WebViewHostOutputSurface.h @@ -33,29 +33,22 @@ namespace WebKit { class WebCompositorOutputSurfaceClient; -class WebCompositorSoftwareOutputDevice; class WebGraphicsContext3D; class WebViewHostOutputSurface : public WebKit::WebCompositorOutputSurface { public: - static PassOwnPtr<WebViewHostOutputSurface> create3d(PassOwnPtr<WebKit::WebGraphicsContext3D>); - static PassOwnPtr<WebViewHostOutputSurface> createSoftware(PassOwnPtr<WebKit::WebCompositorSoftwareOutputDevice>); + explicit WebViewHostOutputSurface(PassOwnPtr<WebKit::WebGraphicsContext3D>); virtual ~WebViewHostOutputSurface(); virtual bool bindToClient(WebCompositorOutputSurfaceClient*) OVERRIDE; virtual const WebKit::WebCompositorOutputSurface::Capabilities& capabilities() const OVERRIDE; virtual WebGraphicsContext3D* context3D() const OVERRIDE; - virtual WebCompositorSoftwareOutputDevice* softwareDevice() const OVERRIDE; virtual void sendFrameToParentCompositor(const WebCompositorFrame&) OVERRIDE; private: - explicit WebViewHostOutputSurface(PassOwnPtr<WebKit::WebGraphicsContext3D>); - explicit WebViewHostOutputSurface(PassOwnPtr<WebKit::WebCompositorSoftwareOutputDevice>); - WebKit::WebCompositorOutputSurface::Capabilities m_capabilities; OwnPtr<WebKit::WebGraphicsContext3D> m_context; - OwnPtr<WebKit::WebCompositorSoftwareOutputDevice> m_softwareDevice; }; } diff --git a/Tools/DumpRenderTree/chromium/WebViewHostSoftwareOutputDevice.cpp b/Tools/DumpRenderTree/chromium/WebViewHostSoftwareOutputDevice.cpp deleted file mode 100644 index ecee9940d..000000000 --- a/Tools/DumpRenderTree/chromium/WebViewHostSoftwareOutputDevice.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 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. - */ - -#include "config.h" - -#include "WebViewHostSoftwareOutputDevice.h" - -#include "SkBitmap.h" -#include "SkDevice.h" -#include <public/WebSize.h> -#include <wtf/Assertions.h> - -namespace WebKit { - -WebImage* WebViewHostSoftwareOutputDevice::lock(bool forWrite) -{ - ASSERT(m_device); - m_image = m_device->accessBitmap(forWrite); - return &m_image; -} - -void WebViewHostSoftwareOutputDevice::unlock() -{ - m_image.reset(); -} - -void WebViewHostSoftwareOutputDevice::didChangeViewportSize(WebSize size) -{ - if (m_device && size.width == m_device->width() && size.height == m_device->height()) - return; - - m_device = adoptPtr(new SkDevice(SkBitmap::kARGB_8888_Config, size.width, size.height, true)); -} - - -} diff --git a/Tools/DumpRenderTree/chromium/WebViewHostSoftwareOutputDevice.h b/Tools/DumpRenderTree/chromium/WebViewHostSoftwareOutputDevice.h deleted file mode 100644 index 5bd551ff9..000000000 --- a/Tools/DumpRenderTree/chromium/WebViewHostSoftwareOutputDevice.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 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 WebViewHostSoftwareOutputDevice_h -#define WebViewHostSoftwareOutputDevice_h - -#include <public/WebCompositorSoftwareOutputDevice.h> -#include <public/WebImage.h> -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> - -class SkDevice; - -namespace WebKit { - -struct WebSize; - -class WebViewHostSoftwareOutputDevice : public WebKit::WebCompositorSoftwareOutputDevice { -public: - virtual WebImage* lock(bool forWrite) OVERRIDE; - virtual void unlock() OVERRIDE; - - virtual void didChangeViewportSize(WebSize) OVERRIDE; - -private: - OwnPtr<SkDevice> m_device; - WebImage m_image; -}; - -} - -#endif // WebViewHostSoftwareOutputDevice_h diff --git a/Tools/DumpRenderTree/chromium/android_fallback_fonts.xml b/Tools/DumpRenderTree/chromium/android_fallback_fonts.xml index 79193b7c4..5ab6c2d59 100644 --- a/Tools/DumpRenderTree/chromium/android_fallback_fonts.xml +++ b/Tools/DumpRenderTree/chromium/android_fallback_fonts.xml @@ -7,32 +7,7 @@ </family> <family> <fileset> - <file>kochi-mincho.ttf</file> + <file>DroidSansFallback.ttf</file> </fileset> </family> - <family> - <fileset> - <file>lohit_hi.ttf</file> - </fileset> - </family> - <family> - <fileset> - <file>lohit_ta.ttf</file> - </fileset> - </family> - <family> - <fileset> - <file>MuktiNarrow.ttf</file> - </fileset> - </family> - <family> - <fileset> - <file>Garuda.ttf</file> - </fileset> - </family> - <family> - <fileset> - <file>lohit_pa.ttf</file> - </fileset> - </family> -</familyset> +</familyset>
\ No newline at end of file diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp index 69a4211a0..c1e480134 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp @@ -68,6 +68,7 @@ volatile bool done = false; static bool dumpPixelsForCurrentTest; static int dumpTree = true; static int printSeparators = true; +static int useX11Window = false; static String dumpFramesAsText(Evas_Object* frame) { @@ -193,6 +194,7 @@ static bool parseCommandLineOptions(int argc, char** argv) static const option options[] = { {"notree", no_argument, &dumpTree, false}, {"tree", no_argument, &dumpTree, true}, + {"gui", no_argument, &useX11Window, true}, {0, 0, 0, 0} }; @@ -418,7 +420,7 @@ void dump() static Ecore_Evas* initEcoreEvas() { - Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0); + Ecore_Evas* ecoreEvas = useX11Window ? ecore_evas_new(0, 0, 0, 800, 600, 0) : ecore_evas_buffer_new(800, 600); if (!ecoreEvas) { shutdownEfl(); exit(EXIT_FAILURE); diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp index 993135ee4..51a78c9b4 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp @@ -139,7 +139,7 @@ Evas_Object* DumpRenderTreeChrome::createView() const return view; } -Evas_Object* DumpRenderTreeChrome::createInspectorView() +Evas_Object* DumpRenderTreeChrome::createWebInspectorView() { Evas_Object* inspectorView = drtViewAdd(m_evas); if (!inspectorView) @@ -161,9 +161,9 @@ Evas_Object* DumpRenderTreeChrome::createInspectorView() return inspectorView; } -void DumpRenderTreeChrome::removeInspectorView() +void DumpRenderTreeChrome::removeWebInspectorView() { - Evas_Object* inspectorView = ewk_view_inspector_view_get(mainView()); + Evas_Object* inspectorView = ewk_view_web_inspector_view_get(mainView()); if (!inspectorView) return; @@ -171,14 +171,14 @@ void DumpRenderTreeChrome::removeInspectorView() evas_object_smart_callback_del(mainFrame, "load,finished", onInspectorFrameLoadFinished); evas_object_del(inspectorView); - ewk_view_inspector_view_set(mainView(), 0); + ewk_view_web_inspector_view_set(mainView(), 0); } void DumpRenderTreeChrome::waitInspectorLoadFinished() { // Waits until the page has finished loading. // Because it can't complete loading inspector.html before loading testURL. - Evas_Object* inspectorView = ewk_view_inspector_view_get(mainView()); + Evas_Object* inspectorView = ewk_view_web_inspector_view_get(mainView()); if (inspectorView) ecore_main_loop_begin(); } @@ -318,7 +318,6 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues() DumpRenderTreeSupportEfl::setSerializeHTTPLoads(false); DumpRenderTreeSupportEfl::setMinimumLogicalFontSize(mainView(), 9); DumpRenderTreeSupportEfl::setCSSRegionsEnabled(mainView(), true); - DumpRenderTreeSupportEfl::setShouldTrackVisitedLinks(false); // Reset capacities for the memory cache for dead objects. static const unsigned cacheTotalCapacity = 8192 * 1024; @@ -677,19 +676,19 @@ void DumpRenderTreeChrome::onWebViewPopulateVisitedLinks(void*, Evas_Object* ewk void DumpRenderTreeChrome::onInspectorViewCreate(void*, Evas_Object*, void*) { - Evas_Object* inspectorView = browser->createInspectorView(); + Evas_Object* inspectorView = browser->createWebInspectorView(); if (inspectorView) - ewk_view_inspector_view_set(browser->mainView(), inspectorView); + ewk_view_web_inspector_view_set(browser->mainView(), inspectorView); } void DumpRenderTreeChrome::onInspectorViewClose(void*, Evas_Object*, void*) { - browser->removeInspectorView(); + browser->removeWebInspectorView(); } void DumpRenderTreeChrome::onInspectorFrameLoadFinished(void*, Evas_Object*, void*) { - Evas_Object* inspectorView = ewk_view_inspector_view_get(browser->mainView()); + Evas_Object* inspectorView = ewk_view_web_inspector_view_get(browser->mainView()); if (inspectorView) ecore_main_loop_quit(); } diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h index 32a365490..267c20003 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h @@ -48,8 +48,8 @@ public: Evas_Object* createNewWindow(); void removeWindow(Evas_Object*); - Evas_Object* createInspectorView(); - void removeInspectorView(); + Evas_Object* createWebInspectorView(); + void removeWebInspectorView(); void waitInspectorLoadFinished(); const Vector<Evas_Object*>& extraViews() const; diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp index d24bf3606..ed31de328 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp @@ -153,15 +153,15 @@ static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Securit return defaultOriginQuota; } -static bool shouldUseTiledBackingStore() +static bool shouldUseSingleBackingStore() { - const char* useTiledBackingStore = getenv("DRT_USE_TILED_BACKING_STORE"); - return useTiledBackingStore && *useTiledBackingStore == '1'; + const char* useSingleBackingStore = getenv("DRT_USE_SINGLE_BACKING_STORE"); + return useSingleBackingStore && *useSingleBackingStore == '1'; } static bool chooseAndInitializeAppropriateSmartClass(Ewk_View_Smart_Class* api) { - return !shouldUseTiledBackingStore() ? ewk_view_single_smart_set(api) : ewk_view_tiled_smart_set(api); + return shouldUseSingleBackingStore() ? ewk_view_single_smart_set(api) : ewk_view_tiled_smart_set(api); } // Taken from the file "WebKit/Tools/DumpRenderTree/chromium/WebViewHost.cpp". diff --git a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp index 19703aee6..964b31c76 100644 --- a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp +++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp @@ -109,7 +109,7 @@ void TestRunner::display() void TestRunner::keepWebHistory() { - DumpRenderTreeSupportEfl::setShouldTrackVisitedLinks(true); + notImplemented(); } JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) @@ -117,6 +117,13 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J return DumpRenderTreeSupportEfl::computedStyleIncludingVisitedInfo(context, value); } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + String result = DumpRenderTreeSupportEfl::layerTreeAsText(browser->mainFrame()); + + return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString(result.utf8().data())); +} + size_t TestRunner::webHistoryItemCount() { const Ewk_History* history = ewk_view_history_get(browser->mainView()); @@ -365,7 +372,7 @@ void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, doub notImplemented(); } -void TestRunner::setMockGeolocationPosition(double, double, double, bool, double, bool, double, bool, double, bool, double) +void TestRunner::setMockGeolocationPosition(double, double, double) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. @@ -732,13 +739,13 @@ void TestRunner::setAsynchronousSpellCheckingEnabled(bool) void TestRunner::showWebInspector() { - ewk_view_inspector_show(browser->mainView()); + ewk_view_web_inspector_show(browser->mainView()); browser->waitInspectorLoadFinished(); } void TestRunner::closeWebInspector() { - ewk_view_inspector_close(browser->mainView()); + ewk_view_web_inspector_close(browser->mainView()); } void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) diff --git a/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp index 25c49e314..6b9edc94b 100644 --- a/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp +++ b/Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp @@ -56,21 +56,18 @@ static inline gchar* replaceCharactersForResults(gchar* str) AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element) : m_element(element) { - if (m_element) - g_object_ref(m_element); + g_object_ref(m_element); } AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other) : m_element(other.m_element) { - if (m_element) - g_object_ref(m_element); + g_object_ref(m_element); } AccessibilityUIElement::~AccessibilityUIElement() { - if (m_element) - g_object_unref(m_element); + g_object_unref(m_element); } void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>& elements) diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp index f574c11e8..1f96622bb 100644 --- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -516,7 +516,6 @@ static void resetDefaultsToConsistentValues() DumpRenderTreeSupportGtk::setCSSGridLayoutEnabled(webView, false); DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webView, true); - DumpRenderTreeSupportGtk::setCSSCustomFilterEnabled(webView, false); DumpRenderTreeSupportGtk::setShadowDOMEnabled(true); DumpRenderTreeSupportGtk::setStyleScopedEnabled(true); } diff --git a/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp index 32d3dd5cb..db9628927 100644 --- a/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp +++ b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp @@ -112,6 +112,13 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J return DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(context, value); } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + // FIXME: implement + JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString("")); + return string; +} + size_t TestRunner::webHistoryItemCount() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); @@ -430,7 +437,7 @@ void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bo // See https://bugs.webkit.org/show_bug.cgi?id=30335. } -void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool, double, bool, double, bool, double, bool, double) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); if (!view) @@ -783,9 +790,6 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value) } else if (g_str_equal(originalName.get(), "WebKitCSSRegionsEnabled")) { DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); return; - } else if (g_str_equal(originalName.get(), "WebKitCSSCustomFilterEnabled")) { - DumpRenderTreeSupportGtk::setCSSCustomFilterEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); - return; } else { fprintf(stderr, "TestRunner::overridePreference tried to override " "unknown preference '%s'.\n", originalName.get()); diff --git a/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm b/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm index 0909b86fa..6e0213241 100644 --- a/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm +++ b/Tools/DumpRenderTree/mac/AccessibilityControllerMac.mm @@ -79,7 +79,6 @@ static id findAccessibleObjectById(id obj, NSString *idAttribute) return obj; END_AX_OBJC_EXCEPTIONS - BEGIN_AX_OBJC_EXCEPTIONS NSArray *children = [obj accessibilityAttributeValue:NSAccessibilityChildrenAttribute]; NSUInteger childrenCount = [children count]; for (NSUInteger i = 0; i < childrenCount; ++i) { @@ -87,7 +86,6 @@ static id findAccessibleObjectById(id obj, NSString *idAttribute) if (result) return result; } - END_AX_OBJC_EXCEPTIONS return 0; } diff --git a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig index 3bc7a2a84..99f525622 100644 --- a/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig +++ b/Tools/DumpRenderTree/mac/Configurations/Base.xcconfig @@ -24,7 +24,7 @@ #include "CompilerVersion.xcconfig" CLANG_WARN_CXX0X_EXTENSIONS = NO; -HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include ForwardingHeaders mac/InternalHeaders $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport ${SRCROOT}/../../Source/JavaScriptCore/icu; +HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include ForwardingHeaders mac/InternalHeaders $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport; FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks; GCC_PREPROCESSOR_DEFINITIONS = ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST; DEBUG_INFORMATION_FORMAT = dwarf-with-dsym; diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm index f70e26259..30ac8254c 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm @@ -57,8 +57,6 @@ #import "WorkQueueItem.h" #import <Carbon/Carbon.h> #import <CoreFoundation/CoreFoundation.h> -#import <JavaScriptCore/HeapStatistics.h> -#import <JavaScriptCore/Options.h> #import <WebCore/FoundationExtras.h> #import <WebKit/DOMElement.h> #import <WebKit/DOMExtensions.h> @@ -89,7 +87,6 @@ #import <getopt.h> #import <objc/objc-runtime.h> #import <wtf/Assertions.h> -#import <wtf/FastMalloc.h> #import <wtf/RetainPtr.h> #import <wtf/Threading.h> #import <wtf/ObjcRuntimeExtras.h> @@ -920,9 +917,7 @@ int main(int argc, const char *argv[]) [DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself dumpRenderTree(argc, argv); [WebCoreStatistics garbageCollectJavaScriptObjects]; - [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts - if (JSC::Options::logHeapStatisticsAtExit()) - JSC::HeapStatistics::reportSuccess(); + [WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts [pool release]; return 0; } @@ -1184,10 +1179,6 @@ void dump() if (gTestRunner->dumpAsAudio()) printf("Content-Transfer-Encoding: base64\n"); - WTF::FastMallocStatistics mallocStats = WTF::fastMallocStatistics(); - printf("DumpMalloc: %li\n", mallocStats.committedVMBytes); - printf("DumpJSHeap: %li\n", JSC::HeapStatistics::usedJSHeap()); - if (resultData) { fwrite([resultData bytes], 1, [resultData length], stdout); diff --git a/Tools/DumpRenderTree/mac/EventSendingController.mm b/Tools/DumpRenderTree/mac/EventSendingController.mm index 482bf93db..dc8b26693 100644 --- a/Tools/DumpRenderTree/mac/EventSendingController.mm +++ b/Tools/DumpRenderTree/mac/EventSendingController.mm @@ -299,31 +299,21 @@ static NSEventType eventTypeForMouseButtonAndAction(int button, MouseAction acti clickCount++; } -static int modifierFlags(const NSString* modifierName) -{ - int flags = 0; - if ([modifierName isEqual:@"ctrlKey"]) - flags |= NSControlKeyMask; - else if ([modifierName isEqual:@"shiftKey"] || [modifierName isEqual:@"rangeSelectionKey"]) - flags |= NSShiftKeyMask; - else if ([modifierName isEqual:@"altKey"]) - flags |= NSAlternateKeyMask; - else if ([modifierName isEqual:@"metaKey"] || [modifierName isEqual:@"addSelectionKey"]) - flags |= NSCommandKeyMask; - - return flags; -} - static int buildModifierFlags(const WebScriptObject* modifiers) { int flags = 0; - if ([modifiers isKindOfClass:[NSString class]]) - return modifierFlags((NSString*)modifiers); - else if (![modifiers isKindOfClass:[WebScriptObject class]]) + if (![modifiers isKindOfClass:[WebScriptObject class]]) return flags; for (unsigned i = 0; [[modifiers webScriptValueAtIndex:i] isKindOfClass:[NSString class]]; i++) { NSString* modifierName = (NSString*)[modifiers webScriptValueAtIndex:i]; - flags |= modifierFlags(modifierName); + if ([modifierName isEqual:@"ctrlKey"]) + flags |= NSControlKeyMask; + else if ([modifierName isEqual:@"shiftKey"] || [modifierName isEqual:@"rangeSelectionKey"]) + flags |= NSShiftKeyMask; + else if ([modifierName isEqual:@"altKey"]) + flags |= NSAlternateKeyMask; + else if ([modifierName isEqual:@"metaKey"] || [modifierName isEqual:@"addSelectionKey"]) + flags |= NSCommandKeyMask; } return flags; } diff --git a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h index 293ea49d0..d4063b81a 100644 --- a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h +++ b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.h @@ -48,8 +48,7 @@ typedef HashMap<uint64_t, WebView *> NotificationViewMap; + (MockWebNotificationProvider *)shared; - (void)simulateWebNotificationClick:(uint64_t)notificationID; -- (void)setWebNotificationOrigin:(NSString *)origin permission:(BOOL)allowed; -- (WebNotificationPermission)policyForOrigin:(WebSecurityOrigin *)origin; +- (void)setWebNotificationOrigin:(NSString*)origin permission:(BOOL)allowed; - (void)removeAllWebNotificationPermissions; - (void)reset; diff --git a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm index 4365d15d0..2b693fda2 100644 --- a/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm +++ b/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm @@ -107,7 +107,7 @@ uint64_t id = [notificationID unsignedLongLongValue]; NotificationIDMap::iterator it = _notifications.find(id); ASSERT(it != _notifications.end()); - [it->value.get() dispatchCloseEvent]; + [it->second.get() dispatchCloseEvent]; _notifications.remove(it); _notificationViewMap.remove(id); } @@ -129,7 +129,7 @@ return WebNotificationPermissionDenied; } -- (void)setWebNotificationOrigin:(NSString *)origin permission:(BOOL)allowed +- (void)setWebNotificationOrigin:(NSString*)origin permission:(BOOL)allowed { [_permissions.get() setObject:[NSNumber numberWithBool:allowed] forKey:origin]; } diff --git a/Tools/DumpRenderTree/mac/TestRunnerMac.mm b/Tools/DumpRenderTree/mac/TestRunnerMac.mm index b520e096f..1a0a04dc7 100644 --- a/Tools/DumpRenderTree/mac/TestRunnerMac.mm +++ b/Tools/DumpRenderTree/mac/TestRunnerMac.mm @@ -42,8 +42,6 @@ #import <JavaScriptCore/JSRetainPtr.h> #import <JavaScriptCore/JSStringRef.h> #import <JavaScriptCore/JSStringRefCF.h> -#import <WebCore/GeolocationPosition.h> -#import <WebCore/PageVisibilityState.h> #import <WebKit/DOMDocument.h> #import <WebKit/DOMElement.h> #import <WebKit/WebApplicationCache.h> @@ -110,10 +108,6 @@ @end -@interface WebGeolocationPosition (Internal) -- (id)initWithGeolocationPosition:(PassRefPtr<WebCore::GeolocationPosition>)coreGeolocationPosition; -@end - TestRunner::~TestRunner() { } @@ -275,6 +269,12 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value]; } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText])); + return string; +} + JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; @@ -472,16 +472,9 @@ void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bo [orientation release]; } -void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { - WebGeolocationPosition *position = nil; - if (!providesAltitude && !providesAltitudeAccuracy && !providesHeading && !providesSpeed) { - // Test the exposed API. - position = [[WebGeolocationPosition alloc] initWithTimestamp:currentTime() latitude:latitude longitude:longitude accuracy:accuracy]; - } else { - RefPtr<WebCore::GeolocationPosition> coreGeolocationPosition = WebCore::GeolocationPosition::create(currentTime(), latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); - position = [[WebGeolocationPosition alloc] initWithGeolocationPosition:(coreGeolocationPosition.release())]; - } + WebGeolocationPosition *position = [[WebGeolocationPosition alloc] initWithTimestamp:currentTime() latitude:latitude longitude:longitude accuracy:accuracy]; [[MockGeolocationProvider shared] setPosition:position]; [position release]; } @@ -899,8 +892,8 @@ unsigned worldIDForWorld(WebScriptWorld *world) { WorldMap::const_iterator end = worldMap().end(); for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { - if (it->value == world) - return it->key; + if (it->second == world) + return it->first; } return 0; @@ -922,7 +915,7 @@ void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef glo if (!worldID) world = [WebScriptWorld world]; else { - RetainPtr<WebScriptWorld>& worldSlot = worldMap().add(worldID, 0).iterator->value; + RetainPtr<WebScriptWorld>& worldSlot = worldMap().add(worldID, 0).iterator->second; if (!worldSlot) worldSlot.adoptNS([[WebScriptWorld alloc] init]); world = worldSlot.get(); @@ -1155,26 +1148,12 @@ void TestRunner::setBackingScaleFactor(double backingScaleFactor) void TestRunner::resetPageVisibility() { - WebView *webView = [mainFrame webView]; - if ([webView respondsToSelector:@selector(_setVisibilityState:isInitialState:)]) { - [webView _setVisibilityState:WebCore::PageVisibilityStateVisible isInitialState:NO]; - } + // FIXME: Implement. } -void TestRunner::setPageVisibility(const char* newVisibility) +void TestRunner::setPageVisibility(const char*) { - if (!newVisibility) - return; - - WebView *webView = [mainFrame webView]; - if (!strcmp(newVisibility, "visible")) - [webView _setVisibilityState:WebCore::PageVisibilityStateVisible isInitialState:NO]; - else if (!strcmp(newVisibility, "hidden")) - [webView _setVisibilityState:WebCore::PageVisibilityStateHidden isInitialState:NO]; - else if (!strcmp(newVisibility, "prerender")) - [webView _setVisibilityState:WebCore::PageVisibilityStatePrerender isInitialState:NO]; - else if (!strcmp(newVisibility, "preview")) - [webView _setVisibilityState:WebCore::PageVisibilityStatePreview isInitialState:NO]; + // FIXME: Implement. } void TestRunner::sendWebIntentResponse(JSStringRef) diff --git a/Tools/DumpRenderTree/mac/UIDelegate.mm b/Tools/DumpRenderTree/mac/UIDelegate.mm index 3473d1797..1b6103ac8 100644 --- a/Tools/DumpRenderTree/mac/UIDelegate.mm +++ b/Tools/DumpRenderTree/mac/UIDelegate.mm @@ -293,19 +293,8 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)webView decidePolicyForNotificationRequestFromOrigin:(WebSecurityOrigin *)origin listener:(id<WebAllowDenyPolicyListener>)listener { - MockWebNotificationProvider *provider = (MockWebNotificationProvider *)[webView _notificationProvider]; - switch ([provider policyForOrigin:origin]) { - case WebNotificationPermissionAllowed: - [listener allow]; - break; - case WebNotificationPermissionDenied: - [listener deny]; - break; - case WebNotificationPermissionNotAllowed: - [provider setWebNotificationOrigin:[origin stringValue] permission:YES]; - [listener allow]; - break; - } + [(MockWebNotificationProvider *)[webView _notificationProvider] setWebNotificationOrigin:[origin stringValue] permission:YES]; + [listener allow]; } - (void)dealloc diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index 1b8d8d3d7..baf025aed 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -17,7 +17,7 @@ INCLUDEPATH += \ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \ $${ROOT_WEBKIT_DIR}/Source/WTF -QT = core gui network testlib webkitwidgets widgets +QT = core gui network testlib webkit widgets have?(QTPRINTSUPPORT): QT += printsupport macx: QT += xml diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp index 260360142..f5e7fc159 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeMain.cpp @@ -57,10 +57,10 @@ #include <wtf/Assertions.h> -void messageHandler(QtMsgType type, const QMessageLogContext&, const QString &message) +void messageHandler(QtMsgType type, const char *message) { - if (type == QtCriticalMsg || type == QtFatalMsg) { - fprintf(stderr, "%s\n", qPrintable(message)); + if (type == QtCriticalMsg) { + fprintf(stderr, "%s\n", message); return; } // do nothing @@ -113,7 +113,7 @@ int main(int argc, char* argv[]) // Has to be done before QApplication is constructed in case // QApplication itself produces debug output. if (suppressQtDebugOutput) - qInstallMessageHandler(messageHandler); + qInstallMsgHandler(messageHandler); WebKit::initializeTestFonts(); diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 0d28cbcc1..46120a7b0 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -471,8 +471,6 @@ DumpRenderTree::DumpRenderTree() DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(true); DumpRenderTreeSupportQt::setInteractiveFormValidationEnabled(webPage(), true); - DumpRenderTreeSupportQt::enableMockScrollbars(); - QFocusEvent event(QEvent::FocusIn, Qt::ActiveWindowFocusReason); QApplication::sendEvent(m_mainView, &event); } @@ -949,23 +947,6 @@ void DumpRenderTree::dump() } else image = DumpRenderTreeSupportQt::paintPagesWithBoundaries(mainFrame); - if (DumpRenderTreeSupportQt::trackRepaintRects(m_page->mainFrame())) { - QVector<QRect> repaintRects; - DumpRenderTreeSupportQt::getTrackedRepaintRects(m_page->mainFrame(), repaintRects); - QImage mask(image.size(), image.format()); - mask.fill(QColor(0, 0, 0, 0.66 * 255)); - - QPainter maskPainter(&mask); - maskPainter.setCompositionMode(QPainter::CompositionMode_Source); - for (int i = 0; i < repaintRects.size(); ++i) - maskPainter.fillRect(repaintRects[i], Qt::transparent); - - QPainter painter(&image); - painter.drawImage(image.rect(), mask); - - DumpRenderTreeSupportQt::setTrackRepaintRects(m_page->mainFrame(), false); - } - QCryptographicHash hash(QCryptographicHash::Md5); for (int row = 0; row < image.height(); ++row) hash.addData(reinterpret_cast<const char*>(image.scanLine(row)), image.width() * 4); diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.cpp b/Tools/DumpRenderTree/qt/EventSenderQt.cpp index fe1e96b67..f0c64c369 100644 --- a/Tools/DumpRenderTree/qt/EventSenderQt.cpp +++ b/Tools/DumpRenderTree/qt/EventSenderQt.cpp @@ -72,7 +72,6 @@ EventSender::EventSender(QWebPage* parent) startOfQueue = 0; m_eventLoop = 0; m_currentButton = 0; - m_currentDragActionsAllowed = 0; resetClickCount(); m_page->view()->installEventFilter(this); // This is a hack that works because we normally scroll 60 pixels (3*20) per tick, but Apple scrolls 120. @@ -185,13 +184,6 @@ void EventSender::mouseUp(int button) } sendOrQueueEvent(event); - - if (m_currentDragData.urls().isEmpty()) - return; - - event = new QDropEvent(m_mousePos, m_currentDragActionsAllowed, &m_currentDragData, m_mouseButtons, Qt::NoModifier); - sendEvent(m_page, event); - m_currentDragData.clear(); } void EventSender::mouseMoveTo(int x, int y) @@ -209,31 +201,6 @@ void EventSender::mouseMoveTo(int x, int y) } sendOrQueueEvent(event); - - if (m_currentDragData.urls().isEmpty()) - return; - - Qt::MouseButtons mouseButtons = m_mouseButtons | Qt::LeftButton; - event = new QDragMoveEvent(m_mousePos, m_currentDragActionsAllowed, &m_currentDragData, mouseButtons, Qt::NoModifier); - sendEvent(m_page, event); -} - -// Simulates a mouse down event for drag without sending an actual mouse down event. -void EventSender::beginDragWithFiles(const QStringList& files) -{ - m_currentDragData.clear(); - QList<QUrl> fileUrls; - QUrl baseUrl = m_page->mainFrame()->baseUrl(); - foreach (const QString& file, files) { - QUrl resolvedUrl = baseUrl.resolved(file); - fileUrls.append(resolvedUrl); - } - - m_currentDragData.setUrls(fileUrls); - m_currentDragActionsAllowed = Qt::CopyAction; - Qt::MouseButtons mouseButtons = m_mouseButtons | Qt::LeftButton; - QDragEnterEvent* event = new QDragEnterEvent(m_mousePos, m_currentDragActionsAllowed, &m_currentDragData, mouseButtons, Qt::NoModifier); - sendEvent(m_page, event); } #ifndef QT_NO_WHEELEVENT diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h index e6d9257d2..8a4d9362a 100644 --- a/Tools/DumpRenderTree/qt/EventSenderQt.h +++ b/Tools/DumpRenderTree/qt/EventSenderQt.h @@ -37,14 +37,12 @@ #include <QEvent> #include <QEventLoop> #include <QGesture> -#include <QMimeData> #include <QMouseEvent> #include <QObject> #include <QPoint> #include <QString> #include <QStringList> #include <QTouchEvent> -#include <Qt> #include <qwebpage.h> #include <qwebframe.h> @@ -89,7 +87,6 @@ public Q_SLOTS: #ifndef QT_NO_GESTURES void gestureTap(int x, int y); #endif - void beginDragWithFiles(const QStringList& files); protected: void timerEvent(QTimerEvent*); @@ -114,8 +111,6 @@ private: int m_currentButton; bool m_mouseButtonPressed; bool m_drag; - QMimeData m_currentDragData; - Qt::DropActions m_currentDragActionsAllowed; QEventLoop* m_eventLoop; QWebFrame* frameUnderMouse() const; QBasicTimer m_clickTimer; diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp index 81f781430..9a92013ed 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.cpp +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp @@ -236,7 +236,6 @@ void TestRunner::simulateLegacyWebNotificationClick(const QString& title) void TestRunner::display() { - DumpRenderTreeSupportQt::setTrackRepaintRects(m_topLoadingFrame, true); emit showPage(); } @@ -678,8 +677,6 @@ void TestRunner::overridePreference(const QString& name, const QVariant& value) settings->setAttribute(QWebSettings::HyperlinkAuditingEnabled, value.toBool()); else if (name == "WebKitAcceleratedCompositingEnabled") settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, value.toBool()); - else if (name == "WebKitDisplayImagesKey") - settings->setAttribute(QWebSettings::AutoLoadImages, value.toBool()); else printf("ERROR: TestRunner::overridePreference() does not support the '%s' preference\n", name.toLatin1().data()); @@ -941,6 +938,11 @@ void TestRunner::setAutomaticLinkDetectionEnabled(bool) // FIXME: Implement this. } +QString TestRunner::layerTreeAsText() +{ + return DumpRenderTreeSupportQt::layerTreeAsText(m_drt->webPage()->mainFrame()); +} + void TestRunner::setTextDirection(const QString& directionName) { if (directionName == "auto") diff --git a/Tools/DumpRenderTree/qt/TestRunnerQt.h b/Tools/DumpRenderTree/qt/TestRunnerQt.h index 9c58f1d83..311bcd9de 100644 --- a/Tools/DumpRenderTree/qt/TestRunnerQt.h +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.h @@ -270,6 +270,7 @@ public Q_SLOTS: long long localStorageDiskUsageForOrigin(const QString& originIdentifier); void observeStorageTrackerNotifications(unsigned number); void syncLocalStorage(); + QString layerTreeAsText(); void setTextDirection(const QString& directionName); void goBack(); void setDefersLoading(bool); diff --git a/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp b/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp index 995c5f115..9e76c8dda 100644 --- a/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp +++ b/Tools/DumpRenderTree/win/AccessibilityControllerWin.cpp @@ -58,7 +58,7 @@ AccessibilityController::~AccessibilityController() UnhookWinEvent(m_notificationsEventHook); for (HashMap<PlatformUIElement, JSObjectRef>::iterator it = m_notificationListeners.begin(); it != m_notificationListeners.end(); ++it) - JSValueUnprotect(frame->globalContext(), it->value); + JSValueUnprotect(frame->globalContext(), it->second); } AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y) @@ -299,7 +299,7 @@ void AccessibilityController::removeNotificationListener() void AccessibilityController::winNotificationReceived(PlatformUIElement element, const string& eventName) { for (HashMap<PlatformUIElement, JSObjectRef>::iterator it = m_notificationListeners.begin(); it != m_notificationListeners.end(); ++it) { - COMPtr<IServiceProvider> thisServiceProvider(Query, it->key); + COMPtr<IServiceProvider> thisServiceProvider(Query, it->first); if (!thisServiceProvider) continue; @@ -322,7 +322,7 @@ void AccessibilityController::winNotificationReceived(PlatformUIElement element, JSRetainPtr<JSStringRef> jsNotification(Adopt, JSStringCreateWithUTF8CString(eventName.c_str())); JSValueRef argument = JSValueMakeString(frame->globalContext(), jsNotification.get()); - JSObjectCallAsFunction(frame->globalContext(), it->value, 0, 1, &argument, 0); + JSObjectCallAsFunction(frame->globalContext(), it->second, NULL, 1, &argument, NULL); } } diff --git a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp index 6859780f3..90b9ae0fc 100644 --- a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp +++ b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp @@ -66,7 +66,7 @@ wstring ResourceLoadDelegate::descriptionSuitableForTestResult(unsigned long ide if (it == m_urlMap.end()) return L"<unknown>"; - return urlSuitableForTestResult(it->value); + return urlSuitableForTestResult(it->second); } wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebURLRequest* request) diff --git a/Tools/DumpRenderTree/win/TestRunnerWin.cpp b/Tools/DumpRenderTree/win/TestRunnerWin.cpp index 3e48ade65..c4400fdcb 100644 --- a/Tools/DumpRenderTree/win/TestRunnerWin.cpp +++ b/Tools/DumpRenderTree/win/TestRunnerWin.cpp @@ -179,6 +179,21 @@ JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, J return JSValueMakeUndefined(context); } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + COMPtr<IWebFramePrivate> framePrivate(Query, frame); + if (!framePrivate) + return false; + + BSTR textBSTR = 0; + HRESULT hr = framePrivate->layerTreeAsText(&textBSTR); + + wstring text(textBSTR, SysStringLen(textBSTR)); + SysFreeString(textBSTR); + JSRetainPtr<JSStringRef> textValueJS(Adopt, JSStringCreateWithCharacters(text.data(), text.length())); + return textValueJS; +} + JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { COMPtr<IWebView> webView; @@ -399,7 +414,7 @@ void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bo // See https://bugs.webkit.org/show_bug.cgi?id=30335. } -void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. @@ -1231,8 +1246,8 @@ unsigned worldIDForWorld(IWebScriptWorld* world) { WorldMap::const_iterator end = worldMap().end(); for (WorldMap::const_iterator it = worldMap().begin(); it != end; ++it) { - if (it->value == world) - return it->key; + if (it->second == world) + return it->first; } return 0; @@ -1256,7 +1271,7 @@ void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef glo if (FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(world), reinterpret_cast<void**>(&world)))) return; } else { - COMPtr<IWebScriptWorld>& worldSlot = worldMap().add(worldID, 0).iterator->value; + COMPtr<IWebScriptWorld>& worldSlot = worldMap().add(worldID, 0).iterator->second; if (!worldSlot && FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(worldSlot), reinterpret_cast<void**>(&worldSlot)))) return; world = worldSlot; diff --git a/Tools/DumpRenderTree/wx/TestRunnerWx.cpp b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp index 35a9137e7..e780cfe52 100644 --- a/Tools/DumpRenderTree/wx/TestRunnerWx.cpp +++ b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp @@ -333,7 +333,7 @@ void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bo // See https://bugs.webkit.org/show_bug.cgi?id=30335. } -void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. @@ -497,6 +497,11 @@ bool TestRunner::callShouldCloseOnWebView() return false; } +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + return 0; +} + JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { return 0; |