diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-07 11:22:47 +0100 |
commit | cfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch) | |
tree | 24d68c6f61c464ecba1e05670b80390ea3b0e50c /Tools/DumpRenderTree/chromium | |
parent | 69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff) | |
download | qtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz |
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Tools/DumpRenderTree/chromium')
22 files changed, 476 insertions, 124 deletions
diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp index b31d7da70..dafafa181 100644 --- a/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp @@ -157,6 +157,7 @@ DRTTestRunner::DRTTestRunner(TestShell* shell) bindMethod("evaluateScriptInIsolatedWorld", &DRTTestRunner::evaluateScriptInIsolatedWorld); bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue); bindMethod("setIsolatedWorldSecurityOrigin", &DRTTestRunner::setIsolatedWorldSecurityOrigin); + bindMethod("setIsolatedWorldContentSecurityPolicy", &DRTTestRunner::setIsolatedWorldContentSecurityPolicy); bindMethod("execCommand", &DRTTestRunner::execCommand); bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors); #if ENABLE(NOTIFICATIONS) @@ -1403,6 +1404,16 @@ void DRTTestRunner::setIsolatedWorldSecurityOrigin(const CppArgumentList& argume m_shell->webView()->focusedFrame()->setIsolatedWorldSecurityOrigin(arguments[0].toInt32(), origin); } +void DRTTestRunner::setIsolatedWorldContentSecurityPolicy(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + + if (arguments.size() != 2 || !arguments[0].isNumber() || !arguments[1].isString()) + return; + + m_shell->webView()->focusedFrame()->setIsolatedWorldContentSecurityPolicy(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); +} + void DRTTestRunner::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { @@ -1560,6 +1571,8 @@ void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVari prefs->webSecurityEnabled = cppVariantToBool(value); else if (key == "WebKitJavaScriptCanOpenWindowsAutomatically") prefs->javaScriptCanOpenWindowsAutomatically = cppVariantToBool(value); + else if (key == "WebKitSupportsMultipleWindows") + prefs->supportsMultipleWindows = cppVariantToBool(value); else if (key == "WebKitDisplayImagesKey") prefs->loadsImagesAutomatically = cppVariantToBool(value); else if (key == "WebKitPluginsEnabled") @@ -1604,6 +1617,8 @@ void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVari prefs->allowRunningOfInsecureContent = cppVariantToBool(value); else if (key == "WebKitCSSCustomFilterEnabled") prefs->cssCustomFilterEnabled = cppVariantToBool(value); + else if (key == "WebKitShouldRespectImageOrientation") + prefs->shouldRespectImageOrientation = cppVariantToBool(value); else if (key == "WebKitWebAudioEnabled") { ASSERT(cppVariantToBool(value)); } else { diff --git a/Tools/DumpRenderTree/chromium/DRTTestRunner.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h index ec4778fd5..c4cb7ace8 100644 --- a/Tools/DumpRenderTree/chromium/DRTTestRunner.h +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h @@ -43,7 +43,23 @@ #define DRTTestRunner_h #include "TestRunner/src/TestRunner.h" +#include "WebDeliveredIntentClient.h" #include "WebTask.h" +#include "WebTextDirection.h" +#include "platform/WebArrayBufferView.h" +#include "platform/WebString.h" +#include "platform/WebURL.h" +#include <wtf/Deque.h> +#include <wtf/OwnPtr.h> + +namespace WebKit { +class WebGeolocationClientMock; +} + +namespace webkit_support { +class ScopedTempDirectory; +} + class TestShell; @@ -281,6 +297,7 @@ public: void evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList&, CppVariant*); void evaluateScriptInIsolatedWorld(const CppArgumentList&, CppVariant*); void setIsolatedWorldSecurityOrigin(const CppArgumentList&, CppVariant*); + void setIsolatedWorldContentSecurityPolicy(const CppArgumentList&, CppVariant*); // The fallback method is called when a nonexistent method is called on // the layout test controller object. diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index 5a3210449..bbd16af32 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -62,6 +62,7 @@ static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-c static const char optionEnableDeferred2DCanvas[] = "--enable-deferred-2d-canvas"; static const char optionEnableAcceleratedPainting[] = "--enable-accelerated-painting"; static const char optionEnableAcceleratedCompositingForVideo[] = "--enable-accelerated-video"; +static const char optionEnableAcceleratedFixedPosition[] = "--enable-accelerated-fixed-position"; static const char optionUseGraphicsContext3DImplementation[] = "--use-graphics-context-3d-implementation="; static const char optionEnablePerTilePainting[] = "--enable-per-tile-painting"; static const char optionEnableDeferredImageDecoding[] = "--enable-deferred-image-decoding"; @@ -127,6 +128,7 @@ int main(int argc, char* argv[]) bool allowExternalPages = false; bool startupDialog = false; bool acceleratedCompositingForVideoEnabled = false; + bool acceleratedCompositingForFixedPositionEnabled = false; bool softwareCompositingEnabled = false; bool threadedCompositingEnabled = false; bool forceCompositingMode = false; @@ -141,6 +143,7 @@ int main(int argc, char* argv[]) string javaScriptFlags; bool encodeBinary = false; bool noTimeout = false; + bool acceleratedAnimationEnabled = false; for (int i = 1; i < argc; ++i) { string argument(argv[i]); if (argument == "-") @@ -163,6 +166,8 @@ int main(int argc, char* argv[]) hardwareAcceleratedGL = true; else if (argument == optionEnableAcceleratedCompositingForVideo) acceleratedCompositingForVideoEnabled = true; + else if (argument == optionEnableAcceleratedFixedPosition) + acceleratedCompositingForFixedPositionEnabled = true; else if (argument == optionEnableSoftwareCompositing) softwareCompositingEnabled = true; else if (argument == optionEnableThreadedCompositing) @@ -219,12 +224,14 @@ int main(int argc, char* argv[]) TestShell shell; shell.setAllowExternalPages(allowExternalPages); shell.setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); + shell.setAcceleratedCompositingForFixedPositionEnabled(acceleratedCompositingForFixedPositionEnabled); shell.setSoftwareCompositingEnabled(softwareCompositingEnabled); shell.setThreadedCompositingEnabled(threadedCompositingEnabled); shell.setForceCompositingMode(forceCompositingMode); shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled); shell.setDeferred2dCanvasEnabled(deferred2DCanvasEnabled); shell.setAcceleratedPaintingEnabled(acceleratedPaintingEnabled); + shell.setAcceleratedAnimationEnabled(acceleratedAnimationEnabled); shell.setPerTilePaintingEnabled(perTilePaintingEnabled); shell.setDeferredImageDecodingEnabled(deferredImageDecodingEnabled); shell.setJavaScriptFlags(javaScriptFlags); diff --git a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp index 6eaf9d603..ca1e6043f 100644 --- a/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp +++ b/Tools/DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp @@ -161,7 +161,7 @@ public: virtual void runIfValid() OVERRIDE { m_dataChannel.dataArrived(m_data, m_length); - delete m_data; + delete [] m_data; } private: diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp index b8aecf100..aa2bf830f 100644 --- a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp +++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp @@ -65,7 +65,6 @@ void TestEventPrinter::handleTextHeader() const void TestEventPrinter::handleTextFooter() const { printf("#EOF\n"); - fprintf(stderr, "#EOF\n"); } void TestEventPrinter::handleAudio(const void* audioData, size_t audioSize) const @@ -95,6 +94,7 @@ void TestEventPrinter::handleImage(const char* actualHash, const char* expectedH void TestEventPrinter::handleTestFooter(bool) const { printf("#EOF\n"); + fprintf(stderr, "#EOF\n"); } void TestEventPrinter::handleBinary(const void* data, size_t size) const diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h index 0df88a77d..47c59efe6 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebEventSender.h @@ -31,7 +31,7 @@ #ifndef WebEventSender_h #define WebEventSender_h -#include "WebDragOperation.h" +#include "WebKit/chromium/public/WebDragOperation.h" namespace WebKit { class WebDragData; diff --git a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h index dd3303352..ab47d4f9d 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h @@ -31,8 +31,8 @@ #ifndef WebTestDelegate_h #define WebTestDelegate_h -#include "platform/WebString.h" -#include "platform/WebVector.h" +#include "Platform/chromium/public/WebString.h" +#include "Platform/chromium/public/WebVector.h" namespace WebKit { struct WebContextMenuData; @@ -51,7 +51,7 @@ public: virtual void setEditCommand(const std::string& name, const std::string& value) = 0; virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; virtual void setGamepadData(const WebKit::WebGamepads&) = 0; - virtual void printMessage(const std::string& message) const = 0; + virtual void printMessage(const std::string& message) = 0; // The delegate takes ownership of the WebTask objects and is responsible // for deleting them. @@ -59,6 +59,8 @@ public: virtual void postDelayedTask(WebTask*, long long ms) = 0; virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) = 0; + virtual long long getCurrentTimeInMillisecond() = 0; + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0; }; } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h index 60cc6271e..47fd466af 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/CppVariant.h @@ -43,7 +43,6 @@ #define CppVariant_h #include "WebBindings.h" -#include "webkit/support/webkit_support.h" #include <string> #include <wtf/Vector.h> diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp index 2f4a0554c..77fcb76e8 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp @@ -43,16 +43,17 @@ #include "config.h" #include "EventSender.h" +#include "KeyCodeMapping.h" #include "TestDelegate.h" #include "WebContextMenuData.h" #include "WebDragOperation.h" +#include "WebEventSender.h" #include "WebTouchPoint.h" #include "WebView.h" #include "platform/WebDragData.h" #include "platform/WebPoint.h" #include "platform/WebString.h" #include "platform/WebVector.h" -#include "webkit/support/webkit_support.h" #include <wtf/Deque.h> #include <wtf/StringExtras.h> @@ -125,9 +126,9 @@ inline bool outsideMultiClickRadius(const WebPoint& a, const WebPoint& b) // dependent (e.g., dragging has a timeout vs selection). uint32 timeOffsetMs = 0; -double getCurrentEventTimeSec() +double getCurrentEventTimeSec(TestDelegate* delegate) { - return (webkit_support::GetCurrentTimeInMillisecond() + timeOffsetMs) / 1000.0; + return (delegate->getCurrentTimeInMillisecond() + timeOffsetMs) / 1000.0; } void advanceEventTime(int32_t deltaMs) @@ -135,7 +136,7 @@ void advanceEventTime(int32_t deltaMs) timeOffsetMs += deltaMs; } -void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoint& pos, WebMouseEvent* e) +void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoint& pos, WebMouseEvent* e, double ts) { e->type = t; e->button = b; @@ -144,7 +145,7 @@ void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b, const WebPoi e->y = pos.y; e->globalX = pos.x; e->globalY = pos.y; - e->timeStampSeconds = getCurrentEventTimeSec(); + e->timeStampSeconds = ts; e->clickCount = clickCount; } @@ -214,16 +215,16 @@ bool getEditCommand(const WebKeyboardEvent& event, string* name) return false; switch (event.windowsKeyCode) { - case webkit_support::VKEY_LEFT: + case VKEY_LEFT: *name = "MoveToBeginningOfLine"; break; - case webkit_support::VKEY_RIGHT: + case VKEY_RIGHT: *name = "MoveToEndOfLine"; break; - case webkit_support::VKEY_UP: + case VKEY_UP: *name = "MoveToBeginningOfDocument"; break; - case webkit_support::VKEY_DOWN: + case VKEY_DOWN: *name = "MoveToEndOfDocument"; break; default: @@ -349,7 +350,7 @@ void EventSender::reset() void EventSender::doDragDrop(const WebDragData& dragData, WebDragOperationsMask mask) { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseDown, pressedButton, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseDown, pressedButton, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); WebPoint clientPoint(event.x, event.y); WebPoint screenPoint(event.globalX, event.globalY); currentDragData = dragData; @@ -392,7 +393,7 @@ int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments) void EventSender::updateClickCountForButton(WebMouseEvent::Button buttonType) { - if ((getCurrentEventTimeSec() - lastClickTimeSec < multipleClickTimeSec) + if ((getCurrentEventTimeSec(m_delegate) - lastClickTimeSec < multipleClickTimeSec) && (!outsideMultiClickRadius(lastMousePos, lastClickPos)) && (buttonType == lastButtonType)) ++clickCount; @@ -422,7 +423,7 @@ void EventSender::mouseDown(const CppArgumentList& arguments, CppVariant* result WebMouseEvent event; pressedButton = buttonType; - initMouseEvent(WebInputEvent::MouseDown, buttonType, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseDown, buttonType, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString())) applyKeyModifiers(&(arguments[1]), &event); webview()->handleInputEvent(event); @@ -448,7 +449,7 @@ void EventSender::mouseUp(const CppArgumentList& arguments, CppVariant* result) replaySavedEvents(); } else { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString())) applyKeyModifiers(&(arguments[1]), &event); doMouseUp(event); @@ -497,7 +498,7 @@ void EventSender::mouseMoveTo(const CppArgumentList& arguments, CppVariant* resu mouseEventQueue.append(savedEvent); } else { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseMove, pressedButton, mousePos, &event); + initMouseEvent(WebInputEvent::MouseMove, pressedButton, mousePos, &event, getCurrentEventTimeSec(m_delegate)); doMouseMove(event); } } @@ -535,50 +536,43 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) bool needsShiftKeyModifier = false; if ("\n" == codeStr) { generateChar = true; - text = code = webkit_support::VKEY_RETURN; + text = code = VKEY_RETURN; } else if ("rightArrow" == codeStr) - code = webkit_support::VKEY_RIGHT; + code = VKEY_RIGHT; else if ("downArrow" == codeStr) - code = webkit_support::VKEY_DOWN; + code = VKEY_DOWN; else if ("leftArrow" == codeStr) - code = webkit_support::VKEY_LEFT; + code = VKEY_LEFT; else if ("upArrow" == codeStr) - code = webkit_support::VKEY_UP; + code = VKEY_UP; else if ("insert" == codeStr) - code = webkit_support::VKEY_INSERT; + code = VKEY_INSERT; else if ("delete" == codeStr) - code = webkit_support::VKEY_DELETE; + code = VKEY_DELETE; else if ("pageUp" == codeStr) - code = webkit_support::VKEY_PRIOR; + code = VKEY_PRIOR; else if ("pageDown" == codeStr) - code = webkit_support::VKEY_NEXT; + code = VKEY_NEXT; else if ("home" == codeStr) - code = webkit_support::VKEY_HOME; + code = VKEY_HOME; else if ("end" == codeStr) - code = webkit_support::VKEY_END; + code = VKEY_END; else if ("printScreen" == codeStr) - code = webkit_support::VKEY_SNAPSHOT; + code = VKEY_SNAPSHOT; else if ("menu" == codeStr) - // FIXME: Change this to webkit_support::VKEY_APPS. - code = 0x5D; + code = VKEY_APPS; else if ("leftControl" == codeStr) - // FIXME: Change this to webkit_support::VKEY_LCONTROL. - code = 0xA2; + code = VKEY_LCONTROL; else if ("rightControl" == codeStr) - // FIXME: Change this to webkit_support::VKEY_RCONTROL. - code = 0xA3; + code = VKEY_RCONTROL; else if ("leftShift" == codeStr) - // FIXME: Change this to webkit_support::VKEY_LSHIFT. - code = 0xA0; + code = VKEY_LSHIFT; else if ("rightShift" == codeStr) - // FIXME: Change this to webkit_support::VKEY_RSHIFT. - code = 0xA1; + code = VKEY_RSHIFT; else if ("leftAlt" == codeStr) - // FIXME: Change this to webkit_support::VKEY_LMENU. - code = 0xA4; + code = VKEY_LMENU; else if ("rightAlt" == codeStr) - // FIXME: Change this to webkit_support::VKEY_RMENU. - code = 0xA5; + code = VKEY_RMENU; else { // Compare the input string with the function-key names defined by the // DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key @@ -588,7 +582,7 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) snprintf(functionChars, 10, "F%d", i); string functionKeyName(functionChars); if (functionKeyName == codeStr) { - code = webkit_support::VKEY_F1 + (i - 1); + code = VKEY_F1 + (i - 1); break; } } @@ -613,7 +607,7 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result) eventDown.modifiers = 0; eventDown.windowsKeyCode = code; #if OS(LINUX) && USE(GTK) - eventDown.nativeKeyCode = webkit_support::NativeKeyCodeForWindowsKeyCode(code, needsShiftKeyModifier); + eventDown.nativeKeyCode = NativeKeyCodeForWindowsKeyCode(code); #endif if (generateChar) { @@ -775,7 +769,7 @@ void EventSender::replaySavedEvents() switch (e.type) { case SavedEvent::MouseMove: { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseMove, pressedButton, e.pos, &event); + initMouseEvent(WebInputEvent::MouseMove, pressedButton, e.pos, &event, getCurrentEventTimeSec(m_delegate)); doMouseMove(event); break; } @@ -784,7 +778,7 @@ void EventSender::replaySavedEvents() break; case SavedEvent::MouseUp: { WebMouseEvent event; - initMouseEvent(WebInputEvent::MouseUp, e.buttonType, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseUp, e.buttonType, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); doMouseUp(event); break; } @@ -843,10 +837,10 @@ void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* res // Generate right mouse down and up. WebMouseEvent event; pressedButton = WebMouseEvent::ButtonRight; - initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); webview()->handleInputEvent(event); - initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); webview()->handleInputEvent(event); pressedButton = WebMouseEvent::ButtonNone; @@ -906,7 +900,7 @@ void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVarian for (size_t i = 0; i < files.size(); ++i) { WebDragData::Item item; item.storageType = WebDragData::Item::StorageTypeFilename; - item.filenameData = webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]); + item.filenameData = m_delegate->getAbsoluteWebStringFromUTF8Path(files[i]); currentDragData.addItem(item); absoluteFilenames[i] = item.filenameData; } @@ -1014,7 +1008,7 @@ void EventSender::sendCurrentTouchEvent(const WebInputEvent::Type type) WebTouchEvent touchEvent; touchEvent.type = type; touchEvent.modifiers = touchModifiers; - touchEvent.timeStampSeconds = getCurrentEventTimeSec(); + touchEvent.timeStampSeconds = getCurrentEventTimeSec(m_delegate); touchEvent.touchesLength = touchPoints.size(); for (unsigned i = 0; i < touchPoints.size(); ++i) touchEvent.touches[i] = touchPoints[i]; @@ -1054,7 +1048,7 @@ void EventSender::handleMouseWheel(const CppArgumentList& arguments, CppVariant* hasPreciseScrollingDeltas = arguments[3].toBoolean(); WebMouseWheelEvent event; - initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event); + initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event, getCurrentEventTimeSec(m_delegate)); event.wheelTicksX = static_cast<float>(horizontal); event.wheelTicksY = static_cast<float>(vertical); event.deltaX = event.wheelTicksX; @@ -1206,10 +1200,18 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& case WebInputEvent::GestureLongPress: event.x = point.x; event.y = point.y; + if (arguments.size() >= 4) { + event.data.tapDown.width = static_cast<float>(arguments[2].toDouble()); + event.data.tapDown.height = static_cast<float>(arguments[3].toDouble()); + } break; case WebInputEvent::GestureTwoFingerTap: event.x = point.x; event.y = point.y; + if (arguments.size() >= 4) { + event.data.twoFingerTap.firstFingerWidth = static_cast<float>(arguments[2].toDouble()); + event.data.twoFingerTap.firstFingerHeight = static_cast<float>(arguments[3].toDouble()); + } break; default: ASSERT_NOT_REACHED(); @@ -1217,7 +1219,7 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& event.globalX = event.x; event.globalY = event.y; - event.timeStampSeconds = getCurrentEventTimeSec(); + event.timeStampSeconds = getCurrentEventTimeSec(m_delegate); webview()->handleInputEvent(event); } @@ -1229,7 +1231,7 @@ void EventSender::gestureFlingCancel(const CppArgumentList& arguments, CppVarian WebGestureEvent event; event.type = WebInputEvent::GestureFlingCancel; - event.timeStampSeconds = getCurrentEventTimeSec(); + event.timeStampSeconds = getCurrentEventTimeSec(m_delegate); webview()->handleInputEvent(event); } @@ -1253,7 +1255,7 @@ void EventSender::gestureFlingStart(const CppArgumentList& arguments, CppVariant event.data.flingStart.velocityX = static_cast<float>(arguments[2].toDouble()); event.data.flingStart.velocityY = static_cast<float>(arguments[3].toDouble()); - event.timeStampSeconds = getCurrentEventTimeSec(); + event.timeStampSeconds = getCurrentEventTimeSec(m_delegate); webview()->handleInputEvent(event); } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp new file mode 100644 index 000000000..c339f2f2b --- /dev/null +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.cpp @@ -0,0 +1,248 @@ +/* + * 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" +#include "KeyCodeMapping.h" + +#include <wtf/UnusedParam.h> + +namespace WebTestRunner { + +int NativeKeyCodeForWindowsKeyCode(int keysym) +{ +#if OS(LINUX) && USE(GTK) + // See /usr/share/X11/xkb/keycodes/* + static const int asciiToKeyCode[] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 22, + 23, + 0, + 0, + 0, + 36, + 0, + 0, + 50, + 37, + 64, + 127, + 66, + 0, + 0, + 0, + 0, + 131, + 0, + 9, + 100, + 102, + 0, + 0, + 65, // ' ' + 112, // '!' + 117, // '"' + 115, // '#' + 110, // '$' + 113, // '%' + 111, // '&' + 114, // ''' + 116, // '(' + 0, // ')' + 107, // '*' + 0, // '+' + 0, // ',' + 118, // '-' + 119, // '.' + 146, // '/' + 19, // '0' + 10, // '1' + 11, // '2' + 12, // '3' + 13, // '4' + 14, // '5' + 15, // '6' + 16, // '7' + 17, // '8' + 18, // '9' + 0, // ':' + 0, // ';' + 0, // '<' + 0, // '=' + 0, // '>' + 0, // '?' + 0, // '@' + 38, // 'A' + 56, // 'B' + 54, // 'C' + 40, // 'D' + 26, // 'E' + 41, // 'F' + 42, // 'G' + 43, // 'H' + 31, // 'I' + 44, // 'J' + 45, // 'K' + 46, // 'L' + 58, // 'M' + 57, // 'N' + 32, // 'O' + 33, // 'P' + 24, // 'Q' + 27, // 'R' + 39, // 'S' + 28, // 'T' + 30, // 'U' + 55, // 'V' + 25, // 'W' + 53, // 'X' + 29, // 'Y' + 52, // 'Z' + 133, // '[' + 134, // '\' + 135, // ']' + 0, // '^' + 0, // '_' + 90, // '`' + 38, // 'a' + 56, // 'b' + 54, // 'c' + 40, // 'd' + 26, // 'e' + 41, // 'f' + 42, // 'g' + 43, // 'h' + 31, // 'i' + 44, // 'j' + 45, // 'k' + 46, // 'l' + 58, // 'm' + 57, // 'n' + 32, // 'o' + 33, // 'p' + 24, // 'q' + 27, // 'r' + 39, // 's' + 28, // 't' + 30, // 'u' + 55, // 'v' + 25, // 'w' + 53, // 'x' + 29, // 'y' + 52, // 'z' + 96, // '{' + 0, // '|' + 0, // '}' + 0, // '~' + 0, // DEL + }; + + if (keysym <= 127) + return asciiToKeyCode[keysym]; + + switch (keysym) { + case VKEY_PRIOR: + return 112; + case VKEY_NEXT: + return 117; + case VKEY_END: + return 115; + case VKEY_HOME: + return 110; + case VKEY_LEFT: + return 113; + case VKEY_UP: + return 111; + case VKEY_RIGHT: + return 114; + case VKEY_DOWN: + return 116; + case VKEY_SNAPSHOT: + return 107; + case VKEY_INSERT: + return 118; + case VKEY_DELETE: + return 119; + case VKEY_APPS: + return 135; + case VKEY_F1: + case VKEY_F1 + 1: + case VKEY_F1 + 2: + case VKEY_F1 + 3: + case VKEY_F1 + 4: + case VKEY_F1 + 5: + case VKEY_F1 + 6: + case VKEY_F1 + 7: + case VKEY_F1 + 8: + case VKEY_F1 + 9: + case VKEY_F1 + 10: + case VKEY_F1 + 11: + case VKEY_F1 + 12: + case VKEY_F1 + 13: + case VKEY_F1 + 14: + case VKEY_F1 + 15: + case VKEY_F1 + 16: + case VKEY_F1 + 17: + case VKEY_F1 + 18: + case VKEY_F1 + 19: + case VKEY_F1 + 20: + case VKEY_F1 + 21: + case VKEY_F1 + 22: + case VKEY_F1 + 23: + return 67 + (keysym - VKEY_F1); + case VKEY_LSHIFT: + return 50; + case VKEY_RSHIFT: + return 62; + case VKEY_LCONTROL: + return 37; + case VKEY_RCONTROL: + return 105; + case VKEY_LMENU: + return 64; + case VKEY_RMENU: + return 108; + + default: + return 0; + } +#else + UNUSED_PARAM(keysym); + return 0; +#endif +} + +} diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h new file mode 100644 index 000000000..87469fac4 --- /dev/null +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/KeyCodeMapping.h @@ -0,0 +1,65 @@ +/* + * 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 KeyCodeMapping_h +#define KeyCodeMapping_h + +namespace WebTestRunner { + +// The keycodes match the values of the virtual keycodes found here http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx +enum { + VKEY_RETURN = 0x0D, + VKEY_PRIOR = 0x21, + VKEY_NEXT = 0x22, + VKEY_END = 0x23, + VKEY_HOME = 0x24, + VKEY_LEFT = 0x25, + VKEY_UP = 0x26, + VKEY_RIGHT = 0x27, + VKEY_DOWN = 0x28, + VKEY_SNAPSHOT = 0x2C, + VKEY_INSERT = 0x2D, + VKEY_DELETE = 0x2E, + VKEY_APPS = 0x5D, + VKEY_F1 = 0x70, + VKEY_LSHIFT = 0xA0, + VKEY_RSHIFT = 0xA1, + VKEY_LCONTROL = 0xA2, + VKEY_RCONTROL = 0xA3, + VKEY_LMENU = 0xA4, + VKEY_RMENU = 0xA5, +}; + +// Map a windows keycode to a native keycode on OS(LINUX) && USE(GTK). +int NativeKeyCodeForWindowsKeyCode(int keysym); + +} + +#endif // KeyCodeMapping_h diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h index 218bbdf42..0498fcb3f 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestDelegate.h @@ -51,10 +51,12 @@ public: virtual void setEditCommand(const std::string& name, const std::string& value) = 0; virtual WebKit::WebContextMenuData* lastContextMenuData() const = 0; virtual void setGamepadData(const WebKit::WebGamepads&) = 0; - virtual void printMessage(const std::string& message) const = 0; + virtual void printMessage(const std::string& message) = 0; virtual void postTask(WebTestRunner::WebTask*) = 0; virtual void postDelayedTask(WebTestRunner::WebTask*, long long ms) = 0; virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) = 0; + virtual long long getCurrentTimeInMillisecond() = 0; + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) = 0; }; #endif // TestDelegate_h diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp index e6ead1551..f0da79831 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp @@ -32,51 +32,6 @@ #include "config.h" #include "TestRunner.h" -#include "WebAnimationController.h" -#include "WebBindings.h" -#include "WebConsoleMessage.h" -#include "WebDeviceOrientation.h" -#include "WebDeviceOrientationClientMock.h" -#include "WebDocument.h" -#include "WebElement.h" -#include "WebFindOptions.h" -#include "WebFrame.h" -#include "WebGeolocationClientMock.h" -#include "WebIDBFactory.h" -#include "WebInputElement.h" -#include "WebIntent.h" -#include "WebIntentRequest.h" -#include "WebKit.h" -#include "WebNotificationPresenter.h" -#include "WebPrintParams.h" -#include "WebScriptSource.h" -#include "WebSecurityPolicy.h" -#include "WebSettings.h" -#include "WebSurroundingText.h" -#include "WebView.h" -#include "WebWorkerInfo.h" -#include "platform/WebData.h" -#include "platform/WebSerializedScriptValue.h" -#include "platform/WebSize.h" -#include "platform/WebURL.h" -#include "v8/include/v8.h" -#include "webkit/support/webkit_support.h" -#include <algorithm> -#include <clocale> -#include <cstdlib> -#include <limits> -#include <sstream> -#include <wtf/OwnArrayPtr.h> -#include <wtf/text/WTFString.h> - -#if OS(LINUX) || OS(ANDROID) -#include "linux/WebFontRendering.h" -#endif - -using namespace WebCore; -using namespace WebKit; -using namespace std; - TestRunner::TestRunner() { } diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h index 39e19d573..503271b5d 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h @@ -33,21 +33,6 @@ #define TestRunner_h #include "CppBoundClass.h" -#include "WebDeliveredIntentClient.h" -#include "WebTextDirection.h" -#include "platform/WebArrayBufferView.h" -#include "platform/WebString.h" -#include "platform/WebURL.h" -#include <wtf/Deque.h> -#include <wtf/OwnPtr.h> - -namespace WebKit { -class WebGeolocationClientMock; -} - -namespace webkit_support { -class ScopedTempDirectory; -} class TestRunner : public CppBoundClass { public: diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp index 632d9664b..9a86953c3 100644 --- a/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp +++ b/Tools/DumpRenderTree/chromium/TestRunner/src/WebTestInterfaces.cpp @@ -63,10 +63,12 @@ public: virtual void setEditCommand(const std::string& name, const std::string& value); virtual WebContextMenuData* lastContextMenuData() const; virtual void setGamepadData(const WebGamepads&); - virtual void printMessage(const std::string& message) const; + virtual void printMessage(const std::string& message); virtual void postTask(WebTask*); virtual void postDelayedTask(WebTask*, long long ms); virtual WebString registerIsolatedFileSystem(const WebVector<WebString>& absoluteFilenames); + virtual long long getCurrentTimeInMillisecond(); + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path); private: TestInterfaces m_interfaces; @@ -127,7 +129,7 @@ void WebTestInterfaces::Internal::setGamepadData(const WebGamepads& pads) m_delegate->setGamepadData(pads); } -void WebTestInterfaces::Internal::printMessage(const std::string& message) const +void WebTestInterfaces::Internal::printMessage(const std::string& message) { m_delegate->printMessage(message); } @@ -147,6 +149,16 @@ WebString WebTestInterfaces::Internal::registerIsolatedFileSystem(const WebVecto return m_delegate->registerIsolatedFileSystem(absoluteFilenames); } +long long WebTestInterfaces::Internal::getCurrentTimeInMillisecond() +{ + return m_delegate->getCurrentTimeInMillisecond(); +} + +WebKit::WebString WebTestInterfaces::Internal::getAbsoluteWebStringFromUTF8Path(const std::string& path) +{ + return m_delegate->getAbsoluteWebStringFromUTF8Path(path); +} + WebTestInterfaces::WebTestInterfaces() { m_internal = new Internal; diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index 2692e7458..4c42dc0dd 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -35,6 +35,7 @@ #include "DRTDevToolsClient.h" #include "DRTTestRunner.h" #include "MockWebPrerenderingSupport.h" +#include "WebCache.h" #include "WebDataSource.h" #include "WebDocument.h" #include "WebElement.h" @@ -109,6 +110,7 @@ TestShell::TestShell() , m_dumpPixelsForCurrentTest(false) , m_allowExternalPages(false) , m_acceleratedCompositingForVideoEnabled(false) + , m_acceleratedCompositingForFixedPositionEnabled(false) , m_softwareCompositingEnabled(false) , m_threadedCompositingEnabled(false) , m_forceCompositingMode(false) @@ -144,6 +146,7 @@ TestShell::TestShell() WebRuntimeFeatures::enableShadowDOM(true); WebRuntimeFeatures::enableStyleScoped(true); WebRuntimeFeatures::enableScriptedSpeech(true); + WebRuntimeFeatures::enableRequestAutocomplete(true); // 30 second is the same as the value in Mac DRT. // If we use a value smaller than the timeout value of @@ -228,6 +231,7 @@ void TestShell::resetWebSettings(WebView& webView) m_prefs.reset(); m_prefs.acceleratedCompositingEnabled = true; m_prefs.acceleratedCompositingForVideoEnabled = m_acceleratedCompositingForVideoEnabled; + m_prefs.acceleratedCompositingForFixedPositionEnabled = m_acceleratedCompositingForFixedPositionEnabled; m_prefs.forceCompositingMode = m_forceCompositingMode; m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled; m_prefs.deferred2dCanvasEnabled = m_deferred2dCanvasEnabled; @@ -318,6 +322,7 @@ void TestShell::resetTestController() webView()->setFixedLayoutSize(WebSize(0, 0)); webView()->mainFrame()->clearOpener(); WebTestingSupport::resetInternalsObject(webView()->mainFrame()); + WebCache::clear(); } void TestShell::loadURL(const WebURL& url) @@ -387,6 +392,11 @@ void TestShell::setPerTilePaintingEnabled(bool enabled) Platform::current()->compositorSupport()->setPerTilePaintingEnabled(enabled); } +void TestShell::setAcceleratedAnimationEnabled(bool enabled) +{ + Platform::current()->compositorSupport()->setAcceleratedAnimationEnabled(enabled); +} + static string dumpDocumentText(WebFrame* frame) { // We use the document element's text instead of the body text here because diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 03315690e..12e1dbbef 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -128,6 +128,7 @@ public: void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } void setAcceleratedCompositingForVideoEnabled(bool enabled) { m_acceleratedCompositingForVideoEnabled = enabled; } + void setAcceleratedCompositingForFixedPositionEnabled(bool enabled) { m_acceleratedCompositingForFixedPositionEnabled = enabled; } bool softwareCompositingEnabled() { return m_softwareCompositingEnabled; } void setSoftwareCompositingEnabled(bool enabled) { m_softwareCompositingEnabled = enabled; } void setThreadedCompositingEnabled(bool enabled) { m_threadedCompositingEnabled = enabled; } @@ -136,6 +137,7 @@ public: void setDeferred2dCanvasEnabled(bool enabled) { m_deferred2dCanvasEnabled = enabled; } void setAcceleratedPaintingEnabled(bool enabled) { m_acceleratedPaintingEnabled = enabled; } void setPerTilePaintingEnabled(bool); + void setAcceleratedAnimationEnabled(bool); void setDeferredImageDecodingEnabled(bool enabled) { m_deferredImageDecodingEnabled = enabled; } #if defined(OS_WIN) // Access to the finished event. Used by the static WatchDog thread. @@ -227,6 +229,7 @@ private: int m_timeout; // timeout value in millisecond bool m_allowExternalPages; bool m_acceleratedCompositingForVideoEnabled; + bool m_acceleratedCompositingForFixedPositionEnabled; bool m_softwareCompositingEnabled; bool m_threadedCompositingEnabled; bool m_forceCompositingMode; diff --git a/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp b/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp index 7080bef18..414db2c1c 100644 --- a/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp +++ b/Tools/DumpRenderTree/chromium/TestWebPlugin.cpp @@ -206,6 +206,8 @@ void TestWebPlugin::updateGeometry(const WebRect& frameRect, if (clipRect == m_rect) return; m_rect = clipRect; + if (m_rect.isEmpty()) + return; m_context->reshape(m_rect.width, m_rect.height); m_context->viewport(0, 0, m_rect.width, m_rect.height); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp index 5c8c92c99..46afbbdb2 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp @@ -85,6 +85,7 @@ void WebPreferences::reset() javaEnabled = false; javaScriptCanAccessClipboard = true; javaScriptCanOpenWindowsAutomatically = true; + supportsMultipleWindows = true; javaScriptEnabled = true; loadsImagesAutomatically = true; localStorageEnabled = true; @@ -111,6 +112,7 @@ void WebPreferences::reset() tabsToLinks = false; hyperlinkAuditingEnabled = false; acceleratedCompositingForVideoEnabled = false; + acceleratedCompositingForFixedPositionEnabled = false; acceleratedCompositingEnabled = false; accelerated2dCanvasEnabled = false; deferred2dCanvasEnabled = false; @@ -120,6 +122,7 @@ void WebPreferences::reset() mediaPlaybackRequiresUserGesture = false; mockScrollbarsEnabled = false; cssCustomFilterEnabled = false; + shouldRespectImageOrientation = false; } static void setStandardFontFamilyWrapper(WebSettings* settings, const WebKit::WebString& font, UScriptCode script) @@ -201,6 +204,7 @@ void WebPreferences::applyTo(WebView* webView) settings->setJavaEnabled(javaEnabled); settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard); settings->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically); + settings->setSupportsMultipleWindows(supportsMultipleWindows); settings->setJavaScriptEnabled(javaScriptEnabled); settings->setLoadsImagesAutomatically(loadsImagesAutomatically); settings->setLocalStorageEnabled(localStorageEnabled); @@ -221,6 +225,8 @@ void WebPreferences::applyTo(WebView* webView) settings->setCaretBrowsingEnabled(caretBrowsingEnabled); settings->setAcceleratedCompositingEnabled(acceleratedCompositingEnabled); settings->setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); + settings->setAcceleratedCompositingForFixedPositionEnabled(acceleratedCompositingForFixedPositionEnabled); + settings->setFixedPositionCreatesStackingContext(acceleratedCompositingForFixedPositionEnabled); settings->setForceCompositingMode(forceCompositingMode); settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled); settings->setDeferred2dCanvasEnabled(deferred2dCanvasEnabled); @@ -229,6 +235,7 @@ void WebPreferences::applyTo(WebView* webView) settings->setMediaPlaybackRequiresUserGesture(mediaPlaybackRequiresUserGesture); settings->setMockScrollbarsEnabled(mockScrollbarsEnabled); settings->setApplyDefaultDeviceScaleFactorInCompositor(forceCompositingMode); + settings->setShouldRespectImageOrientation(shouldRespectImageOrientation); // Fixed values. settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded(); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h index e0315f2d0..36fcd196f 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.h +++ b/Tools/DumpRenderTree/chromium/WebPreferences.h @@ -87,6 +87,7 @@ struct WebPreferences { bool javaEnabled; bool javaScriptCanAccessClipboard; bool javaScriptCanOpenWindowsAutomatically; + bool supportsMultipleWindows; bool javaScriptEnabled; bool loadsImagesAutomatically; bool localStorageEnabled; @@ -104,6 +105,7 @@ struct WebPreferences { bool hyperlinkAuditingEnabled; bool caretBrowsingEnabled; bool acceleratedCompositingForVideoEnabled; + bool acceleratedCompositingForFixedPositionEnabled; bool acceleratedCompositingEnabled; bool forceCompositingMode; bool accelerated2dCanvasEnabled; @@ -113,6 +115,7 @@ struct WebPreferences { bool mediaPlaybackRequiresUserGesture; bool mockScrollbarsEnabled; bool cssCustomFilterEnabled; + bool shouldRespectImageOrientation; WebPreferences() { reset(); } void reset(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 18422db58..98b87bf8e 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -696,6 +696,12 @@ void WebViewHost::postAccessibilityNotification(const WebAccessibilityObject& ob case WebAccessibilityNotificationInvalidStatusChanged: notificationName = "InvalidStatusChanged"; break; + case WebAccessibilityNotificationTextChanged: + notificationName = "TextChanged"; + break; + case WebAccessibilityNotificationAriaAttributeChanged: + notificationName = "AriaAttributeChanged"; + break; default: notificationName = "UnknownNotification"; break; @@ -1480,7 +1486,7 @@ void WebViewHost::setGamepadData(const WebGamepads& pads) webkit_support::SetGamepadData(pads); } -void WebViewHost::printMessage(const std::string& message) const +void WebViewHost::printMessage(const std::string& message) { printf("%s", message.c_str()); } @@ -1500,6 +1506,16 @@ WebString WebViewHost::registerIsolatedFileSystem(const WebVector<WebString>& ab return webkit_support::RegisterIsolatedFileSystem(absoluteFilenames); } +long long WebViewHost::getCurrentTimeInMillisecond() +{ + return webkit_support::GetCurrentTimeInMillisecond(); +} + +WebKit::WebString WebViewHost::getAbsoluteWebStringFromUTF8Path(const std::string& path) +{ + return webkit_support::GetAbsoluteWebStringFromUTF8Path(path); +} + // Public functions ----------------------------------------------------------- WebViewHost::WebViewHost(TestShell* shell) diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 41237cba9..86007194b 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -135,10 +135,12 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual void clearEditCommand() OVERRIDE; virtual void fillSpellingSuggestionList(const WebKit::WebString& word, WebKit::WebVector<WebKit::WebString>* suggestions) OVERRIDE; virtual void setGamepadData(const WebKit::WebGamepads&) OVERRIDE; - virtual void printMessage(const std::string& message) const OVERRIDE; + virtual void printMessage(const std::string& message) OVERRIDE; virtual void postTask(WebTestRunner::WebTask*) OVERRIDE; virtual void postDelayedTask(WebTestRunner::WebTask*, long long ms) OVERRIDE; virtual WebKit::WebString registerIsolatedFileSystem(const WebKit::WebVector<WebKit::WebString>& absoluteFilenames) OVERRIDE; + virtual long long getCurrentTimeInMillisecond() OVERRIDE; + virtual WebKit::WebString getAbsoluteWebStringFromUTF8Path(const std::string& path) OVERRIDE; // NavigationHost virtual bool navigate(const TestNavigationEntry&, bool reload); |