summaryrefslogtreecommitdiffstats
path: root/Tools/DumpRenderTree/chromium
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/DumpRenderTree/chromium')
-rw-r--r--Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp5
-rw-r--r--Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h1
-rw-r--r--Tools/DumpRenderTree/chromium/DumpRenderTree.cpp14
-rw-r--r--Tools/DumpRenderTree/chromium/EventSender.cpp4
-rw-r--r--Tools/DumpRenderTree/chromium/LayoutTestController.cpp134
-rw-r--r--Tools/DumpRenderTree/chromium/LayoutTestController.h33
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.cpp21
-rw-r--r--Tools/DumpRenderTree/chromium/TestShell.h6
-rw-r--r--Tools/DumpRenderTree/chromium/TestShellWin.cpp51
-rw-r--r--Tools/DumpRenderTree/chromium/WebPreferences.cpp2
-rw-r--r--Tools/DumpRenderTree/chromium/WebPreferences.h1
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.cpp6
-rw-r--r--Tools/DumpRenderTree/chromium/WebViewHost.h13
-rw-r--r--Tools/DumpRenderTree/chromium/config.h3
14 files changed, 225 insertions, 69 deletions
diff --git a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
index 76aa781..61e726a 100644
--- a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
+++ b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
@@ -72,11 +72,6 @@ void DRTDevToolsAgent::runtimePropertyChanged(const WebString& name, const WebSt
// FIXME: Implement.
}
-WebCString DRTDevToolsAgent::debuggerScriptSource()
-{
- return webkit_support::GetDevToolsDebuggerScriptSource();
-}
-
WebDevToolsAgentClient::WebKitClientMessageLoop* DRTDevToolsAgent::createClientMessageLoop()
{
return webkit_support::CreateDevToolsMessageLoop();
diff --git a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h
index 4cbc8bc..0ecf61b 100644
--- a/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h
+++ b/Tools/DumpRenderTree/chromium/DRTDevToolsAgent.h
@@ -61,7 +61,6 @@ public:
virtual void sendMessageToInspectorFrontend(const WebKit::WebString&);
virtual int hostIdentifier() { return m_routingID; }
virtual void runtimePropertyChanged(const WebKit::WebString& name, const WebKit::WebString& value);
- virtual WebKit::WebCString debuggerScriptSource();
virtual WebKitClientMessageLoop* createClientMessageLoop();
void asyncCall(const WebKit::WebString& args);
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
index e008432..95fcd58 100644
--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -43,7 +43,8 @@ static const char optionDumpAllPixels[] = "--dump-all-pixels";
static const char optionNotree[] = "--notree";
static const char optionPixelTests[] = "--pixel-tests";
static const char optionThreaded[] = "--threaded";
-static const char optionTree[] = "--tree";
+static const char optionDebugRenderTree[] = "--debug-render-tree";
+static const char optionDebugLayerTree[] = "--debug-layer-tree";
static const char optionPixelTestsWithName[] = "--pixel-tests=";
static const char optionTestShell[] = "--test-shell";
@@ -53,6 +54,7 @@ static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-d
static const char optionHardwareAcceleratedGL[] = "--enable-hardware-gpu";
static const char optionEnableAcceleratedCompositing[] = "--enable-accelerated-compositing";
+static const char optionForceCompositingMode[] = "--force-compositing-mode";
static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas";
static const char optionStressOpt[] = "--stress-opt";
@@ -131,6 +133,7 @@ int main(int argc, char* argv[])
bool allowExternalPages = false;
bool startupDialog = false;
bool acceleratedCompositingEnabled = false;
+ bool forceCompositingMode = false;
bool accelerated2DCanvasEnabled = false;
bool stressOpt = false;
bool stressDeopt = false;
@@ -148,7 +151,11 @@ int main(int argc, char* argv[])
else if (!argument.find(optionPixelTestsWithName)) {
params.dumpPixels = true;
params.pixelFileName = argument.substr(strlen(optionPixelTestsWithName));
- } else if (argument == optionTestShell) {
+ } else if (argument == optionDebugRenderTree)
+ params.debugRenderTree = true;
+ else if (argument == optionDebugLayerTree)
+ params.debugLayerTree = true;
+ else if (argument == optionTestShell) {
testShellMode = true;
serverMode = true;
} else if (argument == optionAllowExternalPages)
@@ -161,6 +168,8 @@ int main(int argc, char* argv[])
hardwareAcceleratedGL = true;
else if (argument == optionEnableAcceleratedCompositing)
acceleratedCompositingEnabled = true;
+ else if (argument == optionForceCompositingMode)
+ forceCompositingMode = true;
else if (argument == optionEnableAccelerated2DCanvas)
accelerated2DCanvasEnabled = true;
else if (argument == optionStressOpt)
@@ -194,6 +203,7 @@ int main(int argc, char* argv[])
TestShell shell(testShellMode);
shell.setAllowExternalPages(allowExternalPages);
shell.setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
+ shell.setForceCompositingMode(forceCompositingMode);
shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled);
shell.setJavaScriptFlags(javaScriptFlags);
shell.setStressOpt(stressOpt);
diff --git a/Tools/DumpRenderTree/chromium/EventSender.cpp b/Tools/DumpRenderTree/chromium/EventSender.cpp
index c5b7aa9..c800c43 100644
--- a/Tools/DumpRenderTree/chromium/EventSender.cpp
+++ b/Tools/DumpRenderTree/chromium/EventSender.cpp
@@ -338,7 +338,7 @@ void EventSender::doDragDrop(const WebDragData& dragData, WebDragOperationsMask
WebPoint screenPoint(event.globalX, event.globalY);
currentDragData = dragData;
currentDragEffectsAllowed = mask;
- currentDragEffect = webview()->dragTargetDragEnter(dragData, 0, clientPoint, screenPoint, currentDragEffectsAllowed);
+ currentDragEffect = webview()->dragTargetDragEnter(dragData, clientPoint, screenPoint, currentDragEffectsAllowed);
// Finish processing events.
replaySavedEvents();
@@ -826,7 +826,7 @@ void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVarian
currentDragEffectsAllowed = WebKit::WebDragOperationCopy;
// Provide a drag source.
- webview()->dragTargetDragEnter(currentDragData, 0, lastMousePos, lastMousePos, currentDragEffectsAllowed);
+ webview()->dragTargetDragEnter(currentDragData, lastMousePos, lastMousePos, currentDragEffectsAllowed);
// dragMode saves events and then replays them later. We don't need/want that.
dragMode.set(false);
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
index b891d1e..d91cd6e 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -73,6 +73,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
: m_shell(shell)
, m_closeRemainingWindows(false)
, m_deferMainResourceDataLoad(false)
+ , m_showDebugLayerTree(false)
, m_workQueue(this)
{
@@ -108,13 +109,14 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
bindMethod("execCommand", &LayoutTestController::execCommand);
bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
+ bindMethod("hasSpellingMarker", &LayoutTestController::hasSpellingMarker);
bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText);
bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
- bindMethod("hasSpellingMarker", &LayoutTestController::hasSpellingMarker);
bindMethod("notifyDone", &LayoutTestController::notifyDone);
bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
bindMethod("numberOfPages", &LayoutTestController::numberOfPages);
+ bindMethod("numberOfPendingGeolocationPermissionRequests", &LayoutTestController:: numberOfPendingGeolocationPermissionRequests);
bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual);
bindMethod("overridePreference", &LayoutTestController::overridePreference);
bindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById);
@@ -137,6 +139,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled);
+ bindMethod("setAutofilled", &LayoutTestController::setAutofilled);
bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
@@ -152,6 +155,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
+ bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled);
bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy);
@@ -162,12 +166,14 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled);
bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
+ bindMethod("setValueForUser", &LayoutTestController::setValueForUser);
bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader);
bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull);
bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect);
bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
bindMethod("setAsynchronousSpellCheckingEnabled", &LayoutTestController::setAsynchronousSpellCheckingEnabled);
+ bindMethod("shadowRoot", &LayoutTestController::shadowRoot);
bindMethod("showWebInspector", &LayoutTestController::showWebInspector);
bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick);
bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
@@ -182,6 +188,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL);
bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView);
bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches);
+ bindMethod("clearApplicationCacheForOrigin", &LayoutTestController::clearApplicationCacheForOrigin);
bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList);
bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory);
@@ -192,7 +199,12 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled);
bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode);
bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject);
-
+ bindMethod("deleteAllLocalStorage", &LayoutTestController::deleteAllLocalStorage);
+ bindMethod("originsWithLocalStorage", &LayoutTestController::originsWithLocalStorage);
+ bindMethod("deleteLocalStorageForOrigin", &LayoutTestController::deleteLocalStorageForOrigin);
+ bindMethod("observeStorageTrackerNotifications", &LayoutTestController::observeStorageTrackerNotifications);
+ bindMethod("syncLocalStorage", &LayoutTestController::syncLocalStorage);
+
// The fallback method is called when an unknown method is invoked.
bindFallbackMethod(&LayoutTestController::fallbackMethod);
@@ -636,6 +648,28 @@ void LayoutTestController::setAsynchronousSpellCheckingEnabled(const CppArgument
result->setNull();
}
+void LayoutTestController::shadowRoot(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 1 || !arguments[0].isObject()) {
+ result->setNull();
+ return;
+ }
+
+ WebElement element;
+ if (!WebBindings::getElement(arguments[0].value.objectValue, &element)) {
+ result->setNull();
+ return;
+ }
+
+ WebNode shadowRoot = element.shadowRoot();
+ if (shadowRoot.isNull()) {
+ result->setNull();
+ return;
+ }
+
+ result->set(WebBindings::makeNode(shadowRoot));
+}
+
void LayoutTestController::showWebInspector(const CppArgumentList&, CppVariant* result)
{
m_shell->showDevTools();
@@ -731,13 +765,25 @@ void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentLis
void LayoutTestController::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result)
{
- // FIXME: implement to support Application Cache Quotas.
+ // FIXME: Implement to support application cache quotas.
+ result->setNull();
+}
+
+void LayoutTestController::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement to support deleting all application cache for an origin.
result->setNull();
}
void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result)
{
- // FIXME: implement to support Application Cache Quotas.
+ // FIXME: Implement to support application cache quotas.
+ result->setNull();
+}
+
+void LayoutTestController::originsWithApplicationCache(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement to support getting origins that have application caches.
result->setNull();
}
@@ -1452,6 +1498,16 @@ void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVa
result->set(numberOfPages);
}
+void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ Vector<WebViewHost*> windowList = m_shell->windowList();
+ int numberOfRequests = 0;
+ for (size_t i = 0; i < windowList.size(); i++)
+ numberOfRequests += windowList[i]->geolocationClientMock()->numberOfPendingPermissionRequests();
+ result->set(numberOfRequests);
+}
+
void LayoutTestController::logErrorToConsole(const std::string& text)
{
m_shell->webViewHost()->didAddMessageToConsole(
@@ -1576,7 +1632,7 @@ void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& argum
void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result)
{
- result->set(m_shell->webView()->mainFrame()->layerTreeAsText().utf8());
+ result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8());
}
void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result)
@@ -1602,3 +1658,71 @@ void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& argume
return;
m_shell->webView()->settings()->setMinimumTimerInterval(arguments[0].toDouble());
}
+
+void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() != 2 || !arguments[1].isBool())
+ return;
+
+ WebElement element;
+ if (!WebBindings::getElement(arguments[0].value.objectValue, &element))
+ return;
+
+ WebInputElement* input = toWebInputElement(&element);
+ if (!input)
+ return;
+
+ input->setAutofilled(arguments[1].value.boolValue);
+}
+
+void LayoutTestController::setValueForUser(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() != 2)
+ return;
+
+ WebElement element;
+ if (!WebBindings::getElement(arguments[0].value.objectValue, &element))
+ return;
+
+ WebInputElement* input = toWebInputElement(&element);
+ if (!input)
+ return;
+
+ input->setValue(cppVariantToWebString(arguments[1]), true);
+}
+
+void LayoutTestController::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*)
+{
+ // Not Implemented
+}
+
+void LayoutTestController::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*)
+{
+ // Not Implemented
+}
+
+void LayoutTestController::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*)
+{
+ // Not Implemented
+}
+
+void LayoutTestController::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*)
+{
+ // Not Implemented
+}
+
+void LayoutTestController::syncLocalStorage(const CppArgumentList&, CppVariant*)
+{
+ // Not Implemented
+}
+
+void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->pluginsEnabled = arguments[0].toBoolean();
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/LayoutTestController.h
index 6150133..a9c6ce4 100644
--- a/Tools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/Tools/DumpRenderTree/chromium/LayoutTestController.h
@@ -270,6 +270,7 @@ public:
void setAllowUniversalAccessFromFileURLs(const CppArgumentList&, CppVariant*);
void setAllowFileAccessFromFileURLs(const CppArgumentList&, CppVariant*);
+ void shadowRoot(const CppArgumentList&, CppVariant*);
// The fallback method is called when a nonexistent method is called on
// the layout test controller object.
@@ -282,9 +283,13 @@ public:
void addOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
void removeOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
- // Clears all Application Caches.
+ // Clears all application caches.
void clearAllApplicationCaches(const CppArgumentList&, CppVariant*);
- // Sets the Application Quota for the localhost origin.
+ // Clears an application cache for an origin.
+ void clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant*);
+ // Returns origins that have application caches.
+ void originsWithApplicationCache(const CppArgumentList&, CppVariant*);
+ // Sets the application cache quota for the localhost origin.
void setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant*);
// Clears all databases.
@@ -305,6 +310,8 @@ public:
// Gets the number of pages to be printed.
void numberOfPages(const CppArgumentList&, CppVariant*);
+ // Gets the number of geolocation permissions requests pending.
+ void numberOfPendingGeolocationPermissionRequests(const CppArgumentList&, CppVariant*);
// Allows layout tests to start Timeline profiling.
void setTimelineProfilingEnabled(const CppArgumentList&, CppVariant*);
@@ -337,6 +344,24 @@ public:
void setMinimumTimerInterval(const CppArgumentList&, CppVariant*);
+ // Expects the first argument to be an input element and the second argument to be a boolean.
+ // Forwards the setAutofilled() call to the element.
+ void setAutofilled(const CppArgumentList&, CppVariant*);
+
+ // Expects the first argument to be an input element and the second argument to be a string value.
+ // Forwards the setValueForUser() call to the element.
+ void setValueForUser(const CppArgumentList&, CppVariant*);
+
+ // LocalStorage origin-related
+ void deleteAllLocalStorage(const CppArgumentList&, CppVariant*);
+ void originsWithLocalStorage(const CppArgumentList&, CppVariant*);
+ void deleteLocalStorageForOrigin(const CppArgumentList&, CppVariant*);
+ void observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*);
+ void syncLocalStorage(const CppArgumentList&, CppVariant*);
+
+ // Enable or disable plugins.
+ void setPluginsEnabled(const CppArgumentList&, CppVariant*);
+
public:
// The following methods are not exposed to JavaScript.
void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
@@ -365,6 +390,7 @@ public:
bool shouldAddFileToPasteboard() { return m_shouldAddFileToPasteboard; }
bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
+ void setShowDebugLayerTree(bool value) { m_showDebugLayerTree = value; }
bool testRepaint() const { return m_testRepaint; }
bool sweepHorizontally() const { return m_sweepHorizontally; }
@@ -538,6 +564,9 @@ private:
// If false, all new requests will not defer the main resource data load.
bool m_deferMainResourceDataLoad;
+ // If true, we will show extended information in the graphics layer tree.
+ bool m_showDebugLayerTree;
+
WorkQueue m_workQueue;
CppVariant m_globalFlag;
diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp
index 2574abc..4790509 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShell.cpp
@@ -85,11 +85,13 @@ TestShell::TestShell(bool testShellMode)
, m_devTools(0)
, m_allowExternalPages(false)
, m_acceleratedCompositingEnabled(false)
+ , m_forceCompositingMode(false)
, m_accelerated2dCanvasEnabled(false)
, m_stressOpt(false)
, m_stressDeopt(false)
, m_dumpWhenFinished(true)
{
+ WebRuntimeFeatures::enableDataTransferItems(true);
WebRuntimeFeatures::enableGeolocation(true);
WebRuntimeFeatures::enableIndexedDatabase(true);
WebRuntimeFeatures::enableFileSystem(true);
@@ -162,6 +164,7 @@ void TestShell::resetWebSettings(WebView& webView)
{
m_prefs.reset();
m_prefs.acceleratedCompositingEnabled = m_acceleratedCompositingEnabled;
+ m_prefs.forceCompositingMode = m_forceCompositingMode;
m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled;
m_prefs.applyTo(&webView);
}
@@ -187,6 +190,9 @@ void TestShell::runFileTest(const TestParams& params)
|| testUrl.find("\\inspector\\") != string::npos)
showDevTools();
+ if (m_params.debugLayerTree)
+ m_layoutTestController->setShowDebugLayerTree(true);
+
if (m_dumpWhenFinished)
m_printer->handleTestHeader(testUrl.c_str());
loadURL(m_params.testUrl);
@@ -453,7 +459,7 @@ void TestShell::dump()
if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size())
FATAL("Short write to stdout, disk full?\n");
} else {
- printf("%s", frame->renderTreeAsText().utf8().data());
+ printf("%s", frame->renderTreeAsText(m_params.debugRenderTree).utf8().data());
bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions();
dumpFrameScrollPosition(frame, recursive);
}
@@ -544,14 +550,12 @@ void TestShell::dumpImage(skia::PlatformCanvas* canvas) const
md5hash.append(hex);
}
- // Only encode and dump the png if the hashes don't match. Encoding the image
- // is really expensive.
+ // Only encode and dump the png if the hashes don't match. Encoding the
+ // image is really expensive.
if (md5hash.compare(m_params.pixelHash)) {
std::vector<unsigned char> png;
- webkit_support::EncodeBGRAPNG(
- reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()),
- sourceBitmap.width(), sourceBitmap.height(),
- static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, &png);
+ webkit_support::EncodeBGRAPNGWithChecksum(reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()), sourceBitmap.width(),
+ sourceBitmap.height(), static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, md5hash, &png);
m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), &png[0], png.size(), m_params.pixelFileName.c_str());
} else
@@ -575,7 +579,8 @@ WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url)
WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url, DRTDevToolsAgent* devToolsAgent)
{
WebViewHost* host = new WebViewHost(this);
- WebView* view = WebView::create(host, devToolsAgent, 0);
+ WebView* view = WebView::create(host);
+ view->setDevToolsAgentClient(devToolsAgent);
host->setWebWidget(view);
m_prefs.applyTo(view);
view->initializeMainFrame(host);
diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h
index ef9be7f..d84d642 100644
--- a/Tools/DumpRenderTree/chromium/TestShell.h
+++ b/Tools/DumpRenderTree/chromium/TestShell.h
@@ -65,6 +65,8 @@ class DRTDevToolsClient;
struct TestParams {
bool dumpTree;
bool dumpPixels;
+ bool debugRenderTree;
+ bool debugLayerTree;
bool printSeparators;
WebKit::WebURL testUrl;
// Resultant image file name. Required only if the test_shell mode.
@@ -74,6 +76,8 @@ struct TestParams {
TestParams()
: dumpTree(true)
, dumpPixels(false)
+ , debugRenderTree(false)
+ , debugLayerTree(false)
, printSeparators(false) {}
};
@@ -125,6 +129,7 @@ public:
void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; }
void setAcceleratedCompositingEnabled(bool enabled) { m_acceleratedCompositingEnabled = enabled; }
+ void setForceCompositingMode(bool enabled) { m_forceCompositingMode = enabled; }
void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; }
#if defined(OS_WIN)
@@ -200,6 +205,7 @@ private:
int m_timeout; // timeout value in millisecond
bool m_allowExternalPages;
bool m_acceleratedCompositingEnabled;
+ bool m_forceCompositingMode;
bool m_accelerated2dCanvasEnabled;
WebPreferences m_prefs;
bool m_stressOpt;
diff --git a/Tools/DumpRenderTree/chromium/TestShellWin.cpp b/Tools/DumpRenderTree/chromium/TestShellWin.cpp
index 3b3ddd9..f82771f 100644
--- a/Tools/DumpRenderTree/chromium/TestShellWin.cpp
+++ b/Tools/DumpRenderTree/chromium/TestShellWin.cpp
@@ -166,39 +166,11 @@ void openStartupDialog()
bool checkLayoutTestSystemDependencies()
{
- std::list<std::string> errors;
-
- OSVERSIONINFOEX versionInfo;
- ::ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX));
- versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
- ::GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo));
-
- // Default to XP metrics, override if on Vista or win 7.
- int requiredVScrollSize = 17;
- int requiredFontSize = -11; // 8 pt
- const wchar_t* requiredFont = L"Tahoma";
- bool isVista = false;
- bool isWin7 = false;
- const DWORD major = versionInfo.dwMajorVersion;
- const DWORD minor = versionInfo.dwMinorVersion;
- const WORD type = versionInfo.wProductType;
- if (major == 6 && minor == 1 && type == VER_NT_WORKSTATION) {
- requiredFont = L"Segoe UI";
- requiredFontSize = -12;
- isWin7 = true;
- } else if (major == 6 && !minor && type == VER_NT_WORKSTATION) {
- requiredFont = L"Segoe UI";
- requiredFontSize = -12; // 9 pt
- isVista = true;
- } else if (!(major == 5 && minor == 1 && type == VER_NT_WORKSTATION)) {
- // The above check is for XP, so that means ...
- errors.push_back("Unsupported Operating System version "
- "(must use XP, Vista, or Windows 7).");
- }
-
// This metric will be 17 when font size is "Normal".
// The size of drop-down menus depends on it.
int verticalScrollSize = ::GetSystemMetrics(SM_CXVSCROLL);
+ int requiredVScrollSize = 17;
+ std::list<std::string> errors;
if (verticalScrollSize != requiredVScrollSize)
errors.push_back("Must use normal size fonts (96 dpi).");
@@ -210,21 +182,22 @@ bool checkLayoutTestSystemDependencies()
if (fontSmoothingEnabled && (fontSmoothingType == FE_FONTSMOOTHINGCLEARTYPE))
errors.push_back("ClearType must be disabled.");
- // Check that we're using the default system fonts
- NONCLIENTMETRICS metrics;
- // Checks Vista or later.
- metrics.cbSize = major >= 6 ? sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
+ // Check that we're using the default system fonts.
+ OSVERSIONINFO versionInfo = {0};
+ versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
+ ::GetVersionEx(&versionInfo);
+ const bool isVistaOrLater = (versionInfo.dwMajorVersion >= 6);
+ NONCLIENTMETRICS metrics = {0};
+ metrics.cbSize = isVistaOrLater ? (sizeof NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
const bool success = !!::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
ASSERT(success);
LOGFONTW* systemFonts[] =
{&metrics.lfStatusFont, &metrics.lfMenuFont, &metrics.lfSmCaptionFont};
-
+ const wchar_t* const requiredFont = isVistaOrLater ? L"Segoe UI" : L"Tahoma";
+ const int requiredFontSize = isVistaOrLater ? -12 : -11;
for (size_t i = 0; i < arraysize(systemFonts); ++i) {
if (systemFonts[i]->lfHeight != requiredFontSize || wcscmp(requiredFont, systemFonts[i]->lfFaceName)) {
- if (isVista || isWin7)
- errors.push_back("Must use either the Aero or Basic theme.");
- else
- errors.push_back("Must use the default XP theme (Luna).");
+ errors.push_back(isVistaOrLater ? "Must use either the Aero or Basic theme." : "Must use the default XP theme (Luna).");
break;
}
}
diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.cpp b/Tools/DumpRenderTree/chromium/WebPreferences.cpp
index 71f5ec7..84f84b6 100644
--- a/Tools/DumpRenderTree/chromium/WebPreferences.cpp
+++ b/Tools/DumpRenderTree/chromium/WebPreferences.cpp
@@ -104,6 +104,7 @@ void WebPreferences::reset()
hyperlinkAuditingEnabled = false;
acceleratedCompositingEnabled = false;
accelerated2dCanvasEnabled = false;
+ forceCompositingMode = false;
}
void WebPreferences::applyTo(WebView* webView)
@@ -149,6 +150,7 @@ void WebPreferences::applyTo(WebView* webView)
webView->setTabsToLinks(tabsToLinks);
settings->setCaretBrowsingEnabled(caretBrowsingEnabled);
settings->setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
+ settings->setForceCompositingMode(forceCompositingMode);
settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
// Fixed values.
diff --git a/Tools/DumpRenderTree/chromium/WebPreferences.h b/Tools/DumpRenderTree/chromium/WebPreferences.h
index 50bb8cc..ad27fb8 100644
--- a/Tools/DumpRenderTree/chromium/WebPreferences.h
+++ b/Tools/DumpRenderTree/chromium/WebPreferences.h
@@ -78,6 +78,7 @@ struct WebPreferences {
bool hyperlinkAuditingEnabled;
bool caretBrowsingEnabled;
bool acceleratedCompositingEnabled;
+ bool forceCompositingMode;
bool accelerated2dCanvasEnabled;
WebPreferences() { reset(); }
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
index a0ed6da..97c00e2 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -1156,6 +1156,12 @@ WebViewHost::~WebViewHost()
webkit_support::QuitMessageLoop();
}
+void WebViewHost::setWebWidget(WebKit::WebWidget* widget)
+{
+ m_webWidget = widget;
+ webView()->setSpellCheckClient(this);
+}
+
WebView* WebViewHost::webView() const
{
ASSERT(m_webWidget);
diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h
index 4fc3400..014be2e 100644
--- a/Tools/DumpRenderTree/chromium/WebViewHost.h
+++ b/Tools/DumpRenderTree/chromium/WebViewHost.h
@@ -37,6 +37,7 @@
#include "WebAccessibilityNotification.h"
#include "WebCursorInfo.h"
#include "WebFrameClient.h"
+#include "WebSpellCheckClient.h"
#include "WebViewClient.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
@@ -64,11 +65,11 @@ namespace skia {
class PlatformCanvas;
}
-class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost {
+class WebViewHost : public WebKit::WebSpellCheckClient, public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost {
public:
WebViewHost(TestShell* shell);
~WebViewHost();
- void setWebWidget(WebKit::WebWidget* widget) { m_webWidget = widget; }
+ void setWebWidget(WebKit::WebWidget*);
WebKit::WebView* webView() const;
WebKit::WebWidget* webWidget() const;
void reset();
@@ -104,6 +105,11 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
// NavigationHost
virtual bool navigate(const TestNavigationEntry&, bool reload);
+ // WebKit::WebSpellCheckClient
+ virtual void spellCheck(const WebKit::WebString&, int& offset, int& length);
+ virtual void requestCheckingOfText(const WebKit::WebString&, WebKit::WebTextCheckingCompletion*);
+ virtual WebKit::WebString autoCorrectWord(const WebKit::WebString&);
+
// WebKit::WebViewClient
virtual WebKit::WebView* createView(WebKit::WebFrame*, const WebKit::WebURLRequest&, const WebKit::WebWindowFeatures&, const WebKit::WebString&);
virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType);
@@ -126,9 +132,6 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual void didChangeContents();
virtual void didEndEditing();
virtual bool handleCurrentKeyboardEvent();
- virtual void spellCheck(const WebKit::WebString&, int& offset, int& length);
- virtual void requestCheckingOfText(const WebKit::WebString&, WebKit::WebTextCheckingCompletion*);
- virtual WebKit::WebString autoCorrectWord(const WebKit::WebString&);
virtual void runModalAlertDialog(WebKit::WebFrame*, const WebKit::WebString&);
virtual bool runModalConfirmDialog(WebKit::WebFrame*, const WebKit::WebString&);
virtual bool runModalPromptDialog(WebKit::WebFrame*, const WebKit::WebString& message, const WebKit::WebString& defaultValue, WebKit::WebString* actualValue);
diff --git a/Tools/DumpRenderTree/chromium/config.h b/Tools/DumpRenderTree/chromium/config.h
index 7dfda18..ed3aad9 100644
--- a/Tools/DumpRenderTree/chromium/config.h
+++ b/Tools/DumpRenderTree/chromium/config.h
@@ -53,4 +53,7 @@
#define JS_EXPORTDATA
#endif
+#define WTF_EXPORT_PRIVATE JS_EXPORTDATA
+#define JS_EXPORT_PRIVATE JS_EXPORTDATA
+
#endif // config_h