diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Tools/DumpRenderTree/chromium | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Tools/DumpRenderTree/chromium')
17 files changed, 218 insertions, 79 deletions
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index aac357636..7b1284d31 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "TestShell.h" +#include "WebCompositor.h" #include "webkit/support/webkit_support.h" #include <v8/include/v8-testing.h> #include <v8/include/v8.h> @@ -59,7 +60,6 @@ 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 optionEnableCompositeToTexture[] = "--enable-composite-to-texture"; static const char optionUseGraphicsContext3DImplementation[] = "--use-graphics-context-3d-implementation="; static const char optionEnablePerTilePainting[] = "--enable-per-tile-painting"; @@ -141,7 +141,6 @@ int main(int argc, char* argv[]) bool startupDialog = false; bool acceleratedCompositingForVideoEnabled = false; bool threadedCompositingEnabled = false; - bool compositeToTexture = false; bool forceCompositingMode = false; bool accelerated2DCanvasEnabled = false; bool deferred2DCanvasEnabled = false; @@ -182,8 +181,6 @@ int main(int argc, char* argv[]) acceleratedCompositingForVideoEnabled = true; else if (argument == optionEnableThreadedCompositing) threadedCompositingEnabled = true; - else if (argument == optionEnableCompositeToTexture) - compositeToTexture = true; else if (argument == optionForceCompositingMode) forceCompositingMode = true; else if (argument == optionEnableAccelerated2DCanvas) @@ -233,11 +230,11 @@ int main(int argc, char* argv[]) openStartupDialog(); { // Explicit scope for the TestShell instance. - TestShell shell(testShellMode); + TestShell shell; + shell.setTestShellMode(testShellMode); shell.setAllowExternalPages(allowExternalPages); shell.setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); shell.setThreadedCompositingEnabled(threadedCompositingEnabled); - shell.setCompositeToTexture(compositeToTexture); shell.setForceCompositingMode(forceCompositingMode); shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled); shell.setDeferred2dCanvasEnabled(deferred2DCanvasEnabled); @@ -250,6 +247,7 @@ int main(int argc, char* argv[]) // 0x20000000ms is big enough for the purpose to avoid timeout in debugging. shell.setLayoutTestTimeout(0x20000000); } + shell.initialize(); if (serverMode && !tests.size()) { #if OS(ANDROID) // Send a signal to host to indicate DRT is ready to process commands. @@ -286,5 +284,8 @@ int main(int argc, char* argv[]) shell.resetTestController(); } + // Shutdown WebCompositor after TestShell is destructed properly. + WebKit::WebCompositor::shutdown(); + return EXIT_SUCCESS; } diff --git a/Tools/DumpRenderTree/chromium/EventSender.cpp b/Tools/DumpRenderTree/chromium/EventSender.cpp index aaae2c320..a15c72c3e 100644 --- a/Tools/DumpRenderTree/chromium/EventSender.cpp +++ b/Tools/DumpRenderTree/chromium/EventSender.cpp @@ -279,8 +279,11 @@ EventSender::EventSender(TestShell* shell) bindMethod("touchMove", &EventSender::touchMove); bindMethod("touchStart", &EventSender::touchStart); bindMethod("updateTouchPoint", &EventSender::updateTouchPoint); + bindMethod("gestureFlingCancel", &EventSender::gestureFlingCancel); + bindMethod("gestureFlingStart", &EventSender::gestureFlingStart); bindMethod("gestureScrollBegin", &EventSender::gestureScrollBegin); bindMethod("gestureScrollEnd", &EventSender::gestureScrollEnd); + bindMethod("gestureScrollFirstPoint", &EventSender::gestureScrollFirstPoint); bindMethod("gestureScrollUpdate", &EventSender::gestureScrollUpdate); bindMethod("gestureTap", &EventSender::gestureTap); bindMethod("zoomPageIn", &EventSender::zoomPageIn); @@ -877,12 +880,15 @@ void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVarian { currentDragData.initialize(); Vector<string> files = arguments[0].toStringVector(); + Vector<WebString> absoluteFilenames; for (size_t i = 0; i < files.size(); ++i) { WebDragData::Item item; item.storageType = WebDragData::Item::StorageTypeFilename; item.filenameData = webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]); currentDragData.addItem(item); + absoluteFilenames.append(item.filenameData); } + currentDragData.setFilesystemId(webkit_support::RegisterIsolatedFileSystem(absoluteFilenames)); currentDragEffectsAllowed = WebKit::WebDragOperationCopy; // Provide a drag source. @@ -1086,6 +1092,16 @@ void EventSender::gestureTap(const CppArgumentList& arguments, CppVariant* resul gestureEvent(WebInputEvent::GestureTap, arguments); } +void EventSender::gestureScrollFirstPoint(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) + return; + + WebPoint point(arguments[0].toInt32(), arguments[1].toInt32()); + m_currentGestureLocation = point; +} + void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& arguments) { if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) @@ -1118,6 +1134,10 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& event.y = m_currentGestureLocation.y; break; case WebInputEvent::GestureTap: + if (arguments.size() >= 4) { + event.deltaX = static_cast<float>(arguments[2].toDouble()); + event.deltaY = static_cast<float>(arguments[3].toDouble()); + } event.x = point.x; event.y = point.y; break; @@ -1131,6 +1151,42 @@ void EventSender::gestureEvent(WebInputEvent::Type type, const CppArgumentList& webview()->handleInputEvent(event); } +void EventSender::gestureFlingCancel(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + if (!arguments.size()) + return; + + WebGestureEvent event; + event.type = WebInputEvent::GestureFlingCancel; + event.timeStampSeconds = getCurrentEventTimeSec(); + webview()->handleInputEvent(event); +} + +void EventSender::gestureFlingStart(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + if (arguments.size() < 4) + return; + + for (int i = 0; i < 4; i++) + if (!arguments[i].isNumber()) + return; + + WebGestureEvent event; + event.type = WebInputEvent::GestureFlingStart; + + event.x = static_cast<float>(arguments[0].toDouble()); + event.y = static_cast<float>(arguments[1].toDouble()); + event.globalX = event.x; + event.globalY = event.y; + + event.deltaX = static_cast<float>(arguments[2].toDouble()); + event.deltaY = static_cast<float>(arguments[3].toDouble()); + event.timeStampSeconds = getCurrentEventTimeSec(); + webview()->handleInputEvent(event); +} + // // Unimplemented stubs // diff --git a/Tools/DumpRenderTree/chromium/EventSender.h b/Tools/DumpRenderTree/chromium/EventSender.h index d57a0830e..5d82d7898 100644 --- a/Tools/DumpRenderTree/chromium/EventSender.h +++ b/Tools/DumpRenderTree/chromium/EventSender.h @@ -97,8 +97,11 @@ public: void touchStart(const CppArgumentList&, CppVariant*); void updateTouchPoint(const CppArgumentList&, CppVariant*); + void gestureFlingCancel(const CppArgumentList&, CppVariant*); + void gestureFlingStart(const CppArgumentList&, CppVariant*); void gestureScrollBegin(const CppArgumentList&, CppVariant*); void gestureScrollEnd(const CppArgumentList&, CppVariant*); + void gestureScrollFirstPoint(const CppArgumentList&, CppVariant*); void gestureScrollUpdate(const CppArgumentList&, CppVariant*); void gestureTap(const CppArgumentList&, CppVariant*); void gestureEvent(WebKit::WebInputEvent::Type, const CppArgumentList&); diff --git a/Tools/DumpRenderTree/chromium/GamepadController.cpp b/Tools/DumpRenderTree/chromium/GamepadController.cpp index 2974d3bcd..d00b953d5 100644 --- a/Tools/DumpRenderTree/chromium/GamepadController.cpp +++ b/Tools/DumpRenderTree/chromium/GamepadController.cpp @@ -68,6 +68,8 @@ void GamepadController::connect(const CppArgumentList& args, CppVariant* result) return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; internalData.items[index].connected = true; internalData.length = 0; for (unsigned i = 0; i < WebKit::WebGamepads::itemsLengthCap; ++i) @@ -84,6 +86,8 @@ void GamepadController::disconnect(const CppArgumentList& args, CppVariant* resu return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; internalData.items[index].connected = false; internalData.length = 0; for (unsigned i = 0; i < WebKit::WebGamepads::itemsLengthCap; ++i) @@ -100,6 +104,8 @@ void GamepadController::setId(const CppArgumentList& args, CppVariant* result) return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; std::string src = args[1].toString(); const char* p = src.c_str(); memset(internalData.items[index].id, 0, sizeof(internalData.items[index].id)); @@ -116,6 +122,8 @@ void GamepadController::setButtonCount(const CppArgumentList& args, CppVariant* return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; int buttons = args[1].toInt32(); internalData.items[index].buttonsLength = buttons; webkit_support::SetGamepadData(internalData); @@ -129,6 +137,8 @@ void GamepadController::setButtonData(const CppArgumentList& args, CppVariant* r return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; int button = args[1].toInt32(); double data = args[2].toDouble(); internalData.items[index].buttons[button] = data; @@ -143,6 +153,8 @@ void GamepadController::setAxisCount(const CppArgumentList& args, CppVariant* re return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; int axes = args[1].toInt32(); internalData.items[index].axesLength = axes; webkit_support::SetGamepadData(internalData); @@ -156,6 +168,8 @@ void GamepadController::setAxisData(const CppArgumentList& args, CppVariant* res return; } int index = args[0].toInt32(); + if (index < 0 || index >= static_cast<int>(WebKit::WebGamepads::itemsLengthCap)) + return; int axis = args[1].toInt32(); double data = args[2].toDouble(); internalData.items[index].axes[axis] = data; diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp index 9c68dffdc..8bb531911 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp @@ -128,15 +128,14 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("enableAutoResizeMode", &LayoutTestController::enableAutoResizeMode); bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector); bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); + bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue); bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin); bindMethod("execCommand", &LayoutTestController::execCommand); bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors); bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission); - bindMethod("hasSpellingMarker", &LayoutTestController::hasSpellingMarker); bindMethod("findString", &LayoutTestController::findString); bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled); bindMethod("hasCustomPageSizeStyle", &LayoutTestController::hasCustomPageSizeStyle); - bindMethod("isPageBoxVisible", &LayoutTestController::isPageBoxVisible); bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText); bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext); bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem); @@ -252,6 +251,7 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindMethod("enableFixedLayoutMode", &LayoutTestController::enableFixedLayoutMode); bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize); bindMethod("selectionAsMarkup", &LayoutTestController::selectionAsMarkup); + bindMethod("setHasCustomFullScreenBehavior", &LayoutTestController::setHasCustomFullScreenBehavior); // The fallback method is called when an unknown method is invoked. bindFallbackMethod(&LayoutTestController::fallbackMethod); @@ -625,7 +625,7 @@ void LayoutTestController::reset() #endif m_shell->webView()->removeAllUserContent(); WebKit::WebSize empty; - m_shell->webView()->enableAutoResizeMode(false, empty, empty); + m_shell->webView()->disableAutoResizeMode(); } m_dumpAsText = false; m_dumpAsAudio = false; @@ -675,6 +675,7 @@ void LayoutTestController::reset() m_workQueue.reset(); m_taskList.revokeAll(); m_shouldStayOnPageAfterHandlingBeforeUnload = false; + m_hasCustomFullScreenBehavior = false; } void LayoutTestController::locationChangeDone() @@ -1191,7 +1192,7 @@ void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentL result->set(false); return; } -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_shell->notificationPresenter()->grantPermission(cppVariantToWebString(arguments[0])); #endif result->set(true); @@ -1203,7 +1204,7 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis result->set(false); return; } -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) if (m_shell->notificationPresenter()->simulateClick(cppVariantToWebString(arguments[0]))) result->set(true); else @@ -1333,6 +1334,36 @@ void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments result->setNull(); } +void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) +{ + v8::HandleScope scope; + WebVector<v8::Local<v8::Value> > values; + if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) { + WebScriptSource source(cppVariantToWebString(arguments[1])); + // This relies on the iframe focusing itself when it loads. This is a bit + // sketchy, but it seems to be what other tests do. + m_shell->webView()->focusedFrame()->executeScriptInIsolatedWorld(arguments[0].toInt32(), &source, 1, 1, &values); + } + result->setNull(); + // Since only one script was added, only one result is expected + if (values.size() == 1 && !values[0].IsEmpty()) { + v8::Local<v8::Value> scriptValue = values[0]; + // FIXME: There are many more types that can be handled. + if (scriptValue->IsString()) { + v8::String::AsciiValue asciiV8(scriptValue); + result->set(std::string(*asciiV8)); + } else if (scriptValue->IsBoolean()) + result->set(scriptValue->ToBoolean()->Value()); + else if (scriptValue->IsNumber()) { + if (scriptValue->IsInt32()) + result->set(scriptValue->ToInt32()->Value()); + else + result->set(scriptValue->ToNumber()->Value()); + } else if (scriptValue->IsNull()) + result->setNull(); + } +} + void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) { @@ -1555,6 +1586,8 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments, prefs->allowRunningOfInsecureContent = cppVariantToBool(value); else if (key == "WebKitHixie76WebSocketProtocolEnabled") prefs->hixie76WebSocketProtocolEnabled = cppVariantToBool(value); + else if (key == "WebKitCSSCustomFilterEnabled") + prefs->cssCustomFilterEnabled = cppVariantToBool(value); else if (key == "WebKitWebAudioEnabled") { ASSERT(cppVariantToBool(value)); } else { @@ -1764,18 +1797,6 @@ void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& argumen result->set(frame->hasCustomPageSizeStyle(pageIndex)); } -void LayoutTestController::isPageBoxVisible(const CppArgumentList& arguments, CppVariant* result) -{ - result->setNull(); - int pageNumber = 0; - if (!parsePageNumber(arguments, 0, &pageNumber)) - return; - WebFrame* frame = m_shell->webView()->mainFrame(); - if (!frame) - return; - result->set(frame->isPageBoxVisible(pageNumber)); -} - void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVariant* result) { result->set(""); @@ -2003,13 +2024,6 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp result->set(element.document().frame()->markerTextForListItem(element).utf8()); } -void LayoutTestController::hasSpellingMarker(const CppArgumentList& arguments, CppVariant* result) -{ - if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) - return; - result->set(m_shell->webView()->mainFrame()->selectionStartHasSpellingMarkerFor(arguments[0].toInt32(), arguments[1].toInt32())); -} - void LayoutTestController::findString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 1 || !arguments[0].isString()) @@ -2193,6 +2207,8 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C m_shell->webView()->setVisibilityState(WebPageVisibilityStateHidden, false); else if (newVisibility == "prerender") m_shell->webView()->setVisibilityState(WebPageVisibilityStatePrerender, false); + else if (newVisibility == "preview") + m_shell->webView()->setVisibilityState(WebPageVisibilityStatePreview, false); } } @@ -2234,6 +2250,14 @@ void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVar setShouldDumpAsAudio(true); } +void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) +{ + result->setNull(); + if (arguments.size() < 1 || !arguments[0].isBool()) + return; + m_hasCustomFullScreenBehavior = arguments[0].toBoolean(); +} + #if ENABLE(POINTER_LOCK) void LayoutTestController::didLosePointerLock(const CppArgumentList&, CppVariant* result) { diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/LayoutTestController.h index 0f5059b2c..7383ecfb5 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.h +++ b/Tools/DumpRenderTree/chromium/LayoutTestController.h @@ -289,6 +289,7 @@ public: void setAllowFileAccessFromFileURLs(const CppArgumentList&, CppVariant*); void setAllowRunningOfInsecureContent(const CppArgumentList&, CppVariant*); + void evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList&, CppVariant*); void evaluateScriptInIsolatedWorld(const CppArgumentList&, CppVariant*); void setIsolatedWorldSecurityOrigin(const CppArgumentList&, CppVariant*); @@ -339,9 +340,6 @@ public: // printing. void hasCustomPageSizeStyle(const CppArgumentList&, CppVariant*); - // Returns the visibililty status of a page box for printing - void isPageBoxVisible(const CppArgumentList&, CppVariant*); - // Gets the page-related property for printed content void pageProperty(const CppArgumentList&, CppVariant*); @@ -385,7 +383,6 @@ public: void loseCompositorContext(const CppArgumentList& args, CppVariant* result); void markerTextForListItem(const CppArgumentList&, CppVariant*); - void hasSpellingMarker(const CppArgumentList&, CppVariant*); void findString(const CppArgumentList&, CppVariant*); void setMinimumTimerInterval(const CppArgumentList&, CppVariant*); @@ -492,6 +489,9 @@ public: bool testRepaint() const { return m_testRepaint; } bool sweepHorizontally() const { return m_sweepHorizontally; } + void setHasCustomFullScreenBehavior(const CppArgumentList&, CppVariant*); + bool hasCustomFullScreenBehavior() const { return m_hasCustomFullScreenBehavior; } + // Called by the webview delegate when the toplevel frame load is done. void locationChangeDone(); @@ -706,6 +706,10 @@ private: WebKit::WebArrayBufferView m_audioData; bool m_shouldStayOnPageAfterHandlingBeforeUnload; + + // If true, calls to WebViewHost::enter/exitFullScreenNow will not result in + // calls to Document::will/did/Enter/ExitFullScreen. + bool m_hasCustomFullScreenBehavior; }; #endif // LayoutTestController_h diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp b/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp index 7809821aa..0c5400f5e 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "NotificationPresenter.h" -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) #include "WebKit.h" #include "platform/WebKitPlatformSupport.h" @@ -151,4 +151,4 @@ void NotificationPresenter::requestPermission( callback->permissionRequestComplete(); } -#endif // ENABLE(NOTIFICATIONS) +#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp index 8246c09be..730d76b27 100644 --- a/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp +++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp @@ -43,6 +43,7 @@ public: void handleTextHeader() const; void handleTextFooter() const; void handleAudioHeader() const; + void handleAudioFooter() const; void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const; void handleImageFooter() const; void handleTestFooter(bool dumpedAnything) const; @@ -56,6 +57,7 @@ public: void handleTextHeader() const; void handleTextFooter() const; void handleAudioHeader() const; + void handleAudioFooter() const; void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const; void handleImageFooter() const; void handleTestFooter(bool dumpedAnything) const; @@ -95,6 +97,7 @@ void DRTPrinter::handleTextHeader() const void DRTPrinter::handleTextFooter() const { printf("#EOF\n"); + fprintf(stderr, "#EOF\n"); } void DRTPrinter::handleAudioHeader() const @@ -102,6 +105,12 @@ void DRTPrinter::handleAudioHeader() const printf("Content-Type: audio/wav\n"); } +void DRTPrinter::handleAudioFooter() const +{ + printf("#EOF\n"); + fprintf(stderr, "#EOF\n"); +} + void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char*) const { ASSERT(actualHash); @@ -119,13 +128,9 @@ void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, c } } -void DRTPrinter::handleImageFooter() const -{ - printf("#EOF\n"); -} - void DRTPrinter::handleTestFooter(bool) const { + printf("#EOF\n"); } // ---------------------------------------------------------------- @@ -153,6 +158,11 @@ void TestShellPrinter::handleAudioHeader() const printf("Content-Type: audio/wav\n"); } +void TestShellPrinter::handleAudioFooter() const +{ + printf("\n"); +} + void TestShellPrinter::handleImage(const char* actualHash, const char*, const unsigned char* imageData, size_t imageSize, const char* fileName) const { ASSERT(actualHash); @@ -173,10 +183,6 @@ void TestShellPrinter::handleImage(const char* actualHash, const char*, const un printf("#MD5:%s\n", actualHash); } -void TestShellPrinter::handleImageFooter() const -{ -} - void TestShellPrinter::handleTestFooter(bool dumpedAnything) const { if (dumpedAnything) diff --git a/Tools/DumpRenderTree/chromium/TestEventPrinter.h b/Tools/DumpRenderTree/chromium/TestEventPrinter.h index f69523c34..374827e18 100644 --- a/Tools/DumpRenderTree/chromium/TestEventPrinter.h +++ b/Tools/DumpRenderTree/chromium/TestEventPrinter.h @@ -44,8 +44,8 @@ public: virtual void handleTextHeader() const = 0; virtual void handleTextFooter() const = 0; virtual void handleAudioHeader() const = 0; + virtual void handleAudioFooter() const = 0; virtual void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const = 0; - virtual void handleImageFooter() const = 0; virtual void handleTestFooter(bool dumpedAnything) const = 0; }; diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index aa668694d..2e036f1a9 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -98,16 +98,15 @@ static void makeCanvasOpaque(SkCanvas* canvas) } } -TestShell::TestShell(bool testShellMode) +TestShell::TestShell() : m_testIsPending(false) , m_testIsPreparing(false) , m_focusedWidget(0) - , m_testShellMode(testShellMode) + , m_testShellMode(false) , m_devTools(0) , m_allowExternalPages(false) , m_acceleratedCompositingForVideoEnabled(false) , m_threadedCompositingEnabled(false) - , m_compositeToTexture(false) , m_forceCompositingMode(false) , m_accelerated2dCanvasEnabled(false) , m_deferred2dCanvasEnabled(false) @@ -124,21 +123,33 @@ TestShell::TestShell(bool testShellMode) WebRuntimeFeatures::enableIndexedDatabase(true); WebRuntimeFeatures::enableFileSystem(true); WebRuntimeFeatures::enableJavaScriptI18NAPI(true); + WebRuntimeFeatures::enableMediaSource(true); + WebRuntimeFeatures::enableEncryptedMedia(true); WebRuntimeFeatures::enableMediaStream(true); - WebRuntimeFeatures::enableWebAudio(true); + WebRuntimeFeatures::enablePeerConnection(true); + WebRuntimeFeatures::enableWebAudio(true); WebRuntimeFeatures::enableVideoTrack(true); WebRuntimeFeatures::enableGamepad(true); WebRuntimeFeatures::enableShadowDOM(true); WebRuntimeFeatures::enableStyleScoped(true); WebRuntimeFeatures::enableScriptedSpeech(true); + // 30 second is the same as the value in Mac DRT. + // If we use a value smaller than the timeout value of + // (new-)run-webkit-tests, (new-)run-webkit-tests misunderstands that a + // timed-out DRT process was crashed. + m_timeout = 30 * 1000; +} + +void TestShell::initialize() +{ m_webPermissions = adoptPtr(new WebPermissions(this)); m_accessibilityController = adoptPtr(new AccessibilityController(this)); m_gamepadController = adoptPtr(new GamepadController(this)); m_layoutTestController = adoptPtr(new LayoutTestController(this)); m_eventSender = adoptPtr(new EventSender(this)); m_textInputController = adoptPtr(new TextInputController(this)); -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); #endif m_printer = m_testShellMode ? TestEventPrinter::createTestShellPrinter() : TestEventPrinter::createDRTPrinter(); @@ -151,13 +162,6 @@ TestShell::TestShell(bool testShellMode) } else WebCompositor::initialize(0); - - // 30 second is the same as the value in Mac DRT. - // If we use a value smaller than the timeout value of - // (new-)run-webkit-tests, (new-)run-webkit-tests misunderstands that a - // timed-out DRT process was crashed. - m_timeout = 30 * 1000; - createMainWindow(); } @@ -176,8 +180,6 @@ TestShell::~TestShell() // Destroy the WebView before its WebViewHost. m_drtDevToolsAgent->setWebView(0); - - WebCompositor::shutdown(); } void TestShell::createDRTDevToolsClient(DRTDevToolsAgent* agent) @@ -218,7 +220,6 @@ void TestShell::resetWebSettings(WebView& webView) m_prefs.reset(); m_prefs.acceleratedCompositingEnabled = true; m_prefs.acceleratedCompositingForVideoEnabled = m_acceleratedCompositingForVideoEnabled; - m_prefs.compositeToTexture = m_compositeToTexture; m_prefs.forceCompositingMode = m_forceCompositingMode; m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled; m_prefs.deferred2dCanvasEnabled = m_deferred2dCanvasEnabled; @@ -294,7 +295,7 @@ void TestShell::resetTestController() m_layoutTestController->reset(); m_eventSender->reset(); m_webViewHost->reset(); -#if ENABLE(NOTIFICATIONS) +#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter->reset(); #endif m_drtDevToolsAgent->reset(); @@ -555,8 +556,7 @@ void TestShell::dump() if (fwrite(webArrayBufferView.baseAddress(), 1, webArrayBufferView.byteLength(), stdout) != webArrayBufferView.byteLength()) FATAL("Short write to stdout, disk full?\n"); - printf("\n"); - + m_printer->handleAudioFooter(); m_printer->handleTestFooter(true); fflush(stdout); @@ -641,7 +641,6 @@ void TestShell::dump() dumpImage(m_webViewHost->canvas()); } - m_printer->handleImageFooter(); m_printer->handleTestFooter(dumpedAnything); fflush(stdout); fflush(stderr); diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index c35ec94b1..c661c57a3 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -82,9 +82,11 @@ struct TestParams { class TestShell { public: - TestShell(bool testShellMode); + TestShell(); ~TestShell(); + void initialize(); + // The main WebView. WebKit::WebView* webView() const { return m_webView; } // Returns the host for the main WebView. @@ -130,9 +132,9 @@ public: bool allowExternalPages() const { return m_allowExternalPages; } void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; } + void setTestShellMode(bool testShellMode) { m_testShellMode = testShellMode; } void setAcceleratedCompositingForVideoEnabled(bool enabled) { m_acceleratedCompositingForVideoEnabled = enabled; } void setThreadedCompositingEnabled(bool enabled) { m_threadedCompositingEnabled = enabled; } - void setCompositeToTexture(bool enabled) { m_compositeToTexture = enabled; } void setForceCompositingMode(bool enabled) { m_forceCompositingMode = enabled; } void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; } void setDeferred2dCanvasEnabled(bool enabled) { m_deferred2dCanvasEnabled = enabled; } @@ -224,7 +226,6 @@ private: bool m_allowExternalPages; bool m_acceleratedCompositingForVideoEnabled; bool m_threadedCompositingEnabled; - bool m_compositeToTexture; bool m_forceCompositingMode; bool m_accelerated2dCanvasEnabled; bool m_deferred2dCanvasEnabled; diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp index 0e3ce6c52..b46c7f650 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp +++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp @@ -111,7 +111,6 @@ void WebPreferences::reset() hyperlinkAuditingEnabled = false; acceleratedCompositingForVideoEnabled = false; acceleratedCompositingEnabled = false; - compositeToTexture = false; accelerated2dCanvasEnabled = false; deferred2dCanvasEnabled = false; acceleratedPaintingEnabled = false; @@ -119,6 +118,7 @@ void WebPreferences::reset() hixie76WebSocketProtocolEnabled = true; perTilePaintingEnabled = false; mockScrollbarsEnabled = false; + cssCustomFilterEnabled = false; } static void setStandardFontFamilyWrapper(WebSettings* settings, const WebKit::WebString& font, UScriptCode script) @@ -195,6 +195,7 @@ void WebPreferences::applyTo(WebView* webView) settings->setDeveloperExtrasEnabled(developerExtrasEnabled); settings->setExperimentalWebGLEnabled(experimentalWebGLEnabled); settings->setExperimentalCSSRegionsEnabled(experimentalCSSRegionsEnabled); + settings->setExperimentalCSSCustomFilterEnabled(cssCustomFilterEnabled); settings->setJavaEnabled(javaEnabled); settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard); settings->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically); @@ -218,7 +219,6 @@ void WebPreferences::applyTo(WebView* webView) settings->setCaretBrowsingEnabled(caretBrowsingEnabled); settings->setAcceleratedCompositingEnabled(acceleratedCompositingEnabled); settings->setAcceleratedCompositingForVideoEnabled(acceleratedCompositingForVideoEnabled); - settings->setCompositeToTextureEnabled(compositeToTexture); settings->setForceCompositingMode(forceCompositingMode); settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled); settings->setDeferred2dCanvasEnabled(deferred2dCanvasEnabled); diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h index 1cb9ab26c..b60c70e34 100644 --- a/Tools/DumpRenderTree/chromium/WebPreferences.h +++ b/Tools/DumpRenderTree/chromium/WebPreferences.h @@ -104,7 +104,6 @@ struct WebPreferences { bool caretBrowsingEnabled; bool acceleratedCompositingForVideoEnabled; bool acceleratedCompositingEnabled; - bool compositeToTexture; bool forceCompositingMode; bool accelerated2dCanvasEnabled; bool deferred2dCanvasEnabled; @@ -112,6 +111,7 @@ struct WebPreferences { bool hixie76WebSocketProtocolEnabled; bool perTilePaintingEnabled; bool mockScrollbarsEnabled; + bool cssCustomFilterEnabled; WebPreferences() { reset(); } void reset(); diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp index 24fc144cb..722192376 100644 --- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp +++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp @@ -65,17 +65,20 @@ bool WebUserMediaClientMock::IsMockStream(const WebURL& url) return trackId.equals("mediastreamtest"); } -void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamRequest, const WebVector<WebMediaStreamSource>& streamSourceVector) +void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamRequest, const WebVector<WebMediaStreamSource>& audioSourcesVector, const WebVector<WebMediaStreamSource>& videoSourcesVector) { ASSERT(!streamRequest.isNull()); WebUserMediaRequest request = streamRequest; const size_t size = 1; - WebVector<WebMediaStreamSource> sourceVector(size); + WebVector<WebMediaStreamSource> audioSources(size); + WebVector<WebMediaStreamSource> videoSources(size); WebString trackId("mediastreamtest"); - WebString trackName("VideoCapture"); - sourceVector[0].initialize(trackId, WebMediaStreamSource::TypeVideo, trackName); - request.requestSucceeded(sourceVector); + WebString audioTrackName("AudioRecord"); + WebString videoTrackName("VideoCapture"); + audioSources[0].initialize(trackId, WebMediaStreamSource::TypeAudio, audioTrackName); + videoSources[0].initialize(trackId, WebMediaStreamSource::TypeVideo, videoTrackName); + request.requestSucceeded(audioSources, videoSources); } void WebUserMediaClientMock::cancelUserMediaRequest(const WebUserMediaRequest&) diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h index 1942e3bdc..9c4970b8c 100644 --- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h +++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.h @@ -50,7 +50,7 @@ public: bool IsMockStream(const WebURL&); - virtual void requestUserMedia(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&); + virtual void requestUserMedia(const WebUserMediaRequest&, const WebVector<WebMediaStreamSource>&, const WebVector<WebMediaStreamSource>&) OVERRIDE; virtual void cancelUserMediaRequest(const WebUserMediaRequest&); private: diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index fde2d6801..d845b7ec0 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -455,7 +455,7 @@ void WebViewHost::requestCheckingOfText(const WebString& text, WebTextCheckingCo { if (text.isEmpty()) { if (completion) - completion->didFinishCheckingText(Vector<WebTextCheckingResult>()); + completion->didCancelCheckingText(); return; } @@ -757,9 +757,16 @@ void WebViewHost::scheduleComposite() } #if ENABLE(REQUEST_ANIMATION_FRAME) +void WebViewHost::serviceAnimation() +{ + if (webView()->settings()->scrollAnimatorEnabled()) + webView()->animate(0.0); + scheduleComposite(); +} + void WebViewHost::scheduleAnimation() { - postDelayedTask(new HostMethodTask(this, &WebViewHost::scheduleComposite), 0); + postDelayedTask(new HostMethodTask(this, &WebViewHost::serviceAnimation), 0); } #endif @@ -1320,7 +1327,21 @@ void WebViewHost::dispatchIntent(WebFrame* source, const WebIntentRequest& reque printf("Received Web Intent: action=%s type=%s\n", request.intent().action().utf8().data(), request.intent().type().utf8().data()); + WebMessagePortChannelArray* ports = request.intent().messagePortChannelsRelease(); m_currentRequest = request; + if (ports) { + printf("Have %d ports\n", static_cast<int>(ports->size())); + for (size_t i = 0; i < ports->size(); ++i) + (*ports)[i]->destroy(); + delete ports; + } + if (!request.intent().service().isEmpty()) + printf("Explicit intent service: %s\n", request.intent().service().spec().data()); + WebVector<WebString> extras = request.intent().extrasNames(); + for (size_t i = 0; i < extras.size(); ++i) { + printf("Extras[%s] = %s\n", extras[i].utf8().data(), + request.intent().extrasValue(extras[i]).utf8().data()); + } } // Public functions ----------------------------------------------------------- @@ -1655,12 +1676,18 @@ void WebViewHost::setAddressBarURL(const WebURL&) void WebViewHost::enterFullScreenNow() { + if (layoutTestController()->hasCustomFullScreenBehavior()) + return; + webView()->willEnterFullScreen(); webView()->didEnterFullScreen(); } void WebViewHost::exitFullScreenNow() { + if (layoutTestController()->hasCustomFullScreenBehavior()) + return; + webView()->willExitFullScreen(); webView()->didExitFullScreen(); } diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index a990ae319..706035d33 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -175,6 +175,7 @@ class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewCl virtual void didAutoResize(const WebKit::WebSize& newSize); virtual void scheduleComposite(); #if ENABLE(REQUEST_ANIMATION_FRAME) + virtual void serviceAnimation(); virtual void scheduleAnimation(); #endif virtual void didFocus(); |