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

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: Refactored to use a shadow PlatformSupport object 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
« webkit/support/webkit_support.h ('K') | « 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 048ef4ea46e0837434dd0091c1f7f50fbdf744a6..1c6d0fb690dac107a28b707b0f8cfb47c46164f4 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_support) {
if (unit_test_mode) {
logging::SetLogAssertHandler(UnitTestAssertHandler);
} else {
@@ -158,9 +159,10 @@ 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_support));
#if defined(OS_ANDROID)
media_player_manager_.reset(
@@ -278,7 +280,8 @@ webkit_support::GraphicsContext3DImplementation
TestEnvironment* test_environment;
-void SetUpTestEnvironmentImpl(bool unit_test_mode) {
+void SetUpTestEnvironmentImpl(bool unit_test_mode,
+ WebKit::Platform* shadow_platform_support) {
base::EnableInProcessStackDumping();
base::EnableTerminationOnHeapCorruption();
@@ -307,7 +310,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_support);
webkit_support::AfterInitialize(unit_test_mode);
if (!unit_test_mode) {
// Load ICU data tables. This has to run after TestEnvironment is created
@@ -322,12 +326,13 @@ void SetUpTestEnvironmentImpl(bool unit_test_mode) {
namespace webkit_support {
-void SetUpTestEnvironment() {
- SetUpTestEnvironmentImpl(false);
+void SetUpTestEnvironment(WebKit::Platform* shadow_platform_support) {
+ SetUpTestEnvironmentImpl(false, shadow_platform_support);
}
-void SetUpTestEnvironmentForUnitTests() {
- SetUpTestEnvironmentImpl(true);
+void SetUpTestEnvironmentForUnitTests(
+ WebKit::Platform* shadow_platform_support) {
+ SetUpTestEnvironmentImpl(true, shadow_platform_support);
}
void TearDownTestEnvironment() {
« webkit/support/webkit_support.h ('K') | « webkit/support/webkit_support.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698