Index: chrome/test/base/chrome_test_launcher.cc |
diff --git a/chrome/test/base/chrome_test_launcher.cc b/chrome/test/base/chrome_test_launcher.cc |
index 6f07e17024db14cb745dc8aa55af6683506f9942..98c0d7448b2721a3b005d985fa496ce7791a12a7 100644 |
--- a/chrome/test/base/chrome_test_launcher.cc |
+++ b/chrome/test/base/chrome_test_launcher.cc |
@@ -42,36 +42,6 @@ class ChromeTestLauncherDelegate : public test_launcher::TestLauncherDelegate { |
return kEmptyTestName; |
} |
- virtual bool Run(int argc, char** argv, int* return_code) OVERRIDE { |
-#if defined(OS_WIN) || defined(OS_LINUX) |
- CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- bool launch_chrome = |
- command_line->HasSwitch(switches::kProcessType) || |
- command_line->HasSwitch(ChromeTestSuite::kLaunchAsBrowser); |
-#endif |
-#if defined(OS_WIN) |
- if (launch_chrome) { |
- sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
- content::InitializeSandboxInfo(&sandbox_info); |
- ChromeMainDelegate chrome_main_delegate; |
- *return_code = content::ContentMain(GetModuleHandle(NULL), |
- &sandbox_info, |
- &chrome_main_delegate); |
- return true; |
- } |
-#elif defined(OS_LINUX) |
- if (launch_chrome) { |
- ChromeMainDelegate chrome_main_delegate; |
- *return_code = content::ContentMain(argc, |
- const_cast<const char**>(argv), |
- &chrome_main_delegate); |
- return true; |
- } |
-#endif // defined(OS_WIN) |
- |
- return false; |
- } |
- |
virtual int RunTestSuite(int argc, char** argv) OVERRIDE { |
return ChromeTestSuite(argc, argv).Run(); |
} |
@@ -118,6 +88,18 @@ class ChromeTestLauncherDelegate : public test_launcher::TestLauncherDelegate { |
#endif |
} |
+ protected: |
+ virtual content::ContentMainDelegate* CreateContentMainDelegate() OVERRIDE { |
+#if defined(OS_WIN) || defined (OS_LINUX) |
+ return new ChromeMainDelegate(); |
+#else |
+ // This delegate is only guaranteed to link on linux and windows, so just |
+ // bail out if we are on any other platform. |
+ NOTREACHED(); |
+ return NULL; |
+#endif |
+ } |
+ |
private: |
#if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) |
std::stack<linked_ptr<views::AcceleratorHandler> > handlers_; |