summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-28 06:53:12 +0000
committertkent@chromium.org <tkent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-28 06:53:12 +0000
commitc8904849377d0cdf7839c436374e663aea4b8b53 (patch)
treedb4365d4d98da7004ffb5549222a162719c21c94
parent3cdf04f0273f93b30a008d3a49234bd4e2b98db4 (diff)
downloadchromium_src-c8904849377d0cdf7839c436374e663aea4b8b53.zip
chromium_src-c8904849377d0cdf7839c436374e663aea4b8b53.tar.gz
chromium_src-c8904849377d0cdf7839c436374e663aea4b8b53.tar.bz2
Make it possible to draw non-mock controls in layout tests
This CL add testRunner.setUseMockTheme(boolean) to the --dump-render-tree environemnt of content shell. The initial value of the flag is 'true.'. BUG=338232 TEST=none; will add layout tests using it. Review URL: https://codereview.chromium.org/148133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247433 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/shell/renderer/test_runner/TestInterfaces.cpp2
-rw-r--r--content/shell/renderer/test_runner/TestRunner.cpp9
-rw-r--r--content/shell/renderer/test_runner/TestRunner.h6
3 files changed, 16 insertions, 1 deletions
diff --git a/content/shell/renderer/test_runner/TestInterfaces.cpp b/content/shell/renderer/test_runner/TestInterfaces.cpp
index 2241d8e..5ce33da 100644
--- a/content/shell/renderer/test_runner/TestInterfaces.cpp
+++ b/content/shell/renderer/test_runner/TestInterfaces.cpp
@@ -174,6 +174,8 @@ const vector<WebTestProxyBase*>& TestInterfaces::windowList()
WebThemeEngine* TestInterfaces::themeEngine()
{
+ if (!m_testRunner->useMockTheme())
+ return 0;
#if defined(USE_DEFAULT_RENDER_THEME) || !(defined(WIN32) || defined(__APPLE__) || defined(ANDROID))
if (!m_themeEngine.get())
m_themeEngine.reset(new WebTestThemeEngineMock());
diff --git a/content/shell/renderer/test_runner/TestRunner.cpp b/content/shell/renderer/test_runner/TestRunner.cpp
index 6efb9a3..99e2861 100644
--- a/content/shell/renderer/test_runner/TestRunner.cpp
+++ b/content/shell/renderer/test_runner/TestRunner.cpp
@@ -279,6 +279,7 @@ TestRunner::TestRunner(TestInterfaces* interfaces)
bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &TestRunner::setShouldStayOnPageAfterHandlingBeforeUnload);
bindMethod("setWillSendRequestClearHeader", &TestRunner::setWillSendRequestClearHeader);
bindMethod("dumpResourceRequestPriorities", &TestRunner::dumpResourceRequestPriorities);
+ bindMethod("setUseMockTheme", &TestRunner::setUseMockTheme);
// The following methods interact with the WebTestProxy.
// The following methods interact with the WebTestDelegate.
@@ -451,7 +452,7 @@ void TestRunner::reset()
m_webPermissions->reset();
m_notificationPresenter->reset();
-
+ m_useMockTheme = true;
m_pointerLocked = false;
m_pointerLockPlannedResult = PointerLockWillSucceed;
@@ -1480,6 +1481,12 @@ void TestRunner::dumpResourceRequestPriorities(const CppArgumentList& arguments,
result->setNull();
}
+void TestRunner::setUseMockTheme(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ m_useMockTheme = arguments.size() < 1 || arguments[0].toBoolean();
+}
+
void TestRunner::useUnfortunateSynchronousResizeMode(const CppArgumentList& arguments, CppVariant* result)
{
result->setNull();
diff --git a/content/shell/renderer/test_runner/TestRunner.h b/content/shell/renderer/test_runner/TestRunner.h
index 2348ca0..f511f7d 100644
--- a/content/shell/renderer/test_runner/TestRunner.h
+++ b/content/shell/renderer/test_runner/TestRunner.h
@@ -84,6 +84,8 @@ public:
void setTestIsRunning(bool);
bool testIsRunning() const { return m_testIsRunning; }
+ bool useMockTheme() const { return m_useMockTheme; }
+
// WebTestRunner implementation.
virtual bool shouldGeneratePixelResults() OVERRIDE;
virtual bool shouldDumpAsAudio() const OVERRIDE;
@@ -432,6 +434,9 @@ private:
// changes. It takes no arguments, and ignores any that may be present.
void dumpResourceRequestPriorities(const CppArgumentList&, CppVariant*);
+ // Sets a flag to enable the mock theme.
+ void setUseMockTheme(const CppArgumentList&, CppVariant*);
+
///////////////////////////////////////////////////////////////////////////
// Methods interacting with the WebTestProxy
@@ -720,6 +725,7 @@ private:
PointerLockWillRespondAsync,
PointerLockWillFailSync,
} m_pointerLockPlannedResult;
+ bool m_useMockTheme;
};
}