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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 630 |
631 const char kGTestFilterFlag[] = "gtest_filter"; | 631 const char kGTestFilterFlag[] = "gtest_filter"; |
632 const char kGTestHelpFlag[] = "gtest_help"; | 632 const char kGTestHelpFlag[] = "gtest_help"; |
633 const char kGTestListTestsFlag[] = "gtest_list_tests"; | 633 const char kGTestListTestsFlag[] = "gtest_list_tests"; |
634 const char kGTestRepeatFlag[] = "gtest_repeat"; | 634 const char kGTestRepeatFlag[] = "gtest_repeat"; |
635 const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; | 635 const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; |
636 const char kGTestOutputFlag[] = "gtest_output"; | 636 const char kGTestOutputFlag[] = "gtest_output"; |
637 | 637 |
638 const char kHelpFlag[] = "help"; | 638 const char kHelpFlag[] = "help"; |
639 | 639 |
640 const char kLaunchAsBrowser[] = "as-browser"; | |
641 | |
642 // See kManualTestPrefix above. | 640 // See kManualTestPrefix above. |
643 const char kRunManualTestsFlag[] = "run-manual"; | 641 const char kRunManualTestsFlag[] = "run-manual"; |
644 | 642 |
645 const char kSingleProcessTestsFlag[] = "single_process"; | 643 const char kSingleProcessTestsFlag[] = "single_process"; |
646 | 644 |
647 const char kWarmupFlag[] = "warmup"; | 645 const char kWarmupFlag[] = "warmup"; |
648 | 646 |
649 | 647 |
650 TestLauncherDelegate::~TestLauncherDelegate() { | 648 TestLauncherDelegate::~TestLauncherDelegate() { |
651 } | 649 } |
652 | 650 |
653 bool ShouldRunContentMain() { | 651 bool ShouldRunContentMain() { |
654 #if defined(OS_WIN) || defined(OS_LINUX) | 652 #if defined(OS_WIN) || defined(OS_LINUX) |
655 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 653 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
656 return command_line->HasSwitch(switches::kProcessType) || | 654 return command_line->HasSwitch(switches::kProcessType) || |
657 command_line->HasSwitch(kLaunchAsBrowser); | 655 command_line->HasSwitch(switches::kLaunchAsBrowser); |
658 #else | 656 #else |
659 return false; | 657 return false; |
660 #endif // defined(OS_WIN) || defined(OS_LINUX) | 658 #endif // defined(OS_WIN) || defined(OS_LINUX) |
661 } | 659 } |
662 | 660 |
663 int RunContentMain(int argc, char** argv, | 661 int RunContentMain(int argc, char** argv, |
664 TestLauncherDelegate* launcher_delegate) { | 662 TestLauncherDelegate* launcher_delegate) { |
665 #if defined(OS_WIN) | 663 #if defined(OS_WIN) |
666 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 664 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
667 InitializeSandboxInfo(&sandbox_info); | 665 InitializeSandboxInfo(&sandbox_info); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 cycles--; | 771 cycles--; |
774 } | 772 } |
775 return exit_code; | 773 return exit_code; |
776 } | 774 } |
777 | 775 |
778 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { | 776 TestLauncherDelegate* GetCurrentTestLauncherDelegate() { |
779 return g_launcher_delegate; | 777 return g_launcher_delegate; |
780 } | 778 } |
781 | 779 |
782 } // namespace content | 780 } // namespace content |
OLD | NEW |