| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/test/test_launcher.h" | 5 #include "content/public/test/test_launcher.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 const char kSingleProcessTestsFlag[] = "single_process"; | 424 const char kSingleProcessTestsFlag[] = "single_process"; |
| 425 | 425 |
| 426 | 426 |
| 427 TestLauncherDelegate::~TestLauncherDelegate() { | 427 TestLauncherDelegate::~TestLauncherDelegate() { |
| 428 } | 428 } |
| 429 | 429 |
| 430 #if defined(OS_WIN) || defined(OS_LINUX) | 430 #if defined(OS_WIN) || defined(OS_LINUX) |
| 431 bool ShouldRunContentMain() { | 431 bool ShouldRunContentMain() { |
| 432 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 432 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 433 return command_line->HasSwitch(switches::kProcessType) || | 433 return command_line->HasSwitch(switches::kProcessType) || |
| 434 command_line->HasSwitch(kLaunchAsBrowser); | 434 command_line->HasSwitch(kLaunchAsBrowser); |
| 435 return false; | |
| 436 } | 435 } |
| 437 | 436 |
| 438 int RunContentMain(int argc, char** argv, | 437 int RunContentMain(int argc, char** argv, |
| 439 TestLauncherDelegate* launcher_delegate) { | 438 TestLauncherDelegate* launcher_delegate) { |
| 440 scoped_ptr<ContentMainDelegate> chrome_main_delegate( | 439 scoped_ptr<ContentMainDelegate> chrome_main_delegate( |
| 441 launcher_delegate->CreateContentMainDelegate()); | 440 launcher_delegate->CreateContentMainDelegate()); |
| 442 ContentMainParams params(chrome_main_delegate.get()); | 441 ContentMainParams params(chrome_main_delegate.get()); |
| 443 | 442 |
| 444 #if defined(OS_WIN) | 443 #if defined(OS_WIN) |
| 445 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 444 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 base::TestLauncher launcher(&delegate, default_jobs); | 511 base::TestLauncher launcher(&delegate, default_jobs); |
| 513 bool success = launcher.Run(argc, argv); | 512 bool success = launcher.Run(argc, argv); |
| 514 return (success ? 0 : 1); | 513 return (success ? 0 : 1); |
| 515 } | 514 } |
| 516 | 515 |
| 517 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 516 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
| 518 return g_launcher_delegate; | 517 return g_launcher_delegate; |
| 519 } | 518 } |
| 520 | 519 |
| 521 } // namespace content | 520 } // namespace content |
| OLD | NEW |