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

Unified Diff: chrome/test/base/chrome_test_launcher.cc

Issue 10912070: Makes it possible to run content_browsertests with --as-browser and fake WebRTC devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed accidently added files. Created 8 years, 3 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 | « no previous file | chrome/test/base/chrome_test_suite.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « no previous file | chrome/test/base/chrome_test_suite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698