Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: webkit/support/webkit_support.cc

Issue 10703114: Adding support for overriding TestWebKitPlatformSupport in DumpRenderTree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Fixed review comments" Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/support/webkit_support.cc
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 3eabf4debba5809e0a213144aa5875fc39edb95e..31c00882753673623ab3ee215574ef69bd4bf84a 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -149,7 +149,8 @@ class TestEnvironment {
#endif
TestEnvironment(bool unit_test_mode,
- base::AtExitManager* existing_at_exit_manager) {
+ base::AtExitManager* existing_at_exit_manager,
+ WebKit::Platform* shadow_platform_delegate) {
if (unit_test_mode) {
logging::SetLogAssertHandler(UnitTestAssertHandler);
} else {
@@ -158,9 +159,11 @@ class TestEnvironment {
InitLogging();
}
main_message_loop_.reset(new MessageLoopType);
+
// TestWebKitPlatformSupport must be instantiated after MessageLoopType.
webkit_platform_support_.reset(
- new TestWebKitPlatformSupport(unit_test_mode));
+ new TestWebKitPlatformSupport(unit_test_mode,
+ shadow_platform_delegate));
#if defined(OS_ANDROID)
media_player_manager_.reset(
@@ -278,7 +281,8 @@ webkit_support::GraphicsContext3DImplementation
TestEnvironment* test_environment;
-void SetUpTestEnvironmentImpl(bool unit_test_mode) {
+void SetUpTestEnvironmentImpl(bool unit_test_mode,
+ WebKit::Platform* shadow_platform_delegate) {
base::EnableInProcessStackDumping();
base::EnableTerminationOnHeapCorruption();
@@ -307,7 +311,8 @@ void SetUpTestEnvironmentImpl(bool unit_test_mode) {
at_exit_manager = new base::AtExitManager;
#endif
webkit_support::BeforeInitialize(unit_test_mode);
- test_environment = new TestEnvironment(unit_test_mode, at_exit_manager);
+ test_environment = new TestEnvironment(unit_test_mode, at_exit_manager,
+ shadow_platform_delegate);
webkit_support::AfterInitialize(unit_test_mode);
if (!unit_test_mode) {
// Load ICU data tables. This has to run after TestEnvironment is created
@@ -323,11 +328,20 @@ void SetUpTestEnvironmentImpl(bool unit_test_mode) {
namespace webkit_support {
void SetUpTestEnvironment() {
- SetUpTestEnvironmentImpl(false);
+ SetUpTestEnvironment(NULL);
}
void SetUpTestEnvironmentForUnitTests() {
- SetUpTestEnvironmentImpl(true);
+ SetUpTestEnvironmentForUnitTests(NULL);
+}
+
+void SetUpTestEnvironment(WebKit::Platform* shadow_platform_delegate) {
+ SetUpTestEnvironmentImpl(false, shadow_platform_delegate);
+}
+
+void SetUpTestEnvironmentForUnitTests(
+ WebKit::Platform* shadow_platform_delegate) {
+ SetUpTestEnvironmentImpl(true, shadow_platform_delegate);
}
void TearDownTestEnvironment() {
« no previous file with comments | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698