| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 #include "base/base_switches.h" | 27 #include "base/base_switches.h" |
| 28 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
| 29 #include "chrome/common/sandbox_policy.h" | 29 #include "chrome/common/sandbox_policy.h" |
| 30 #include "sandbox/src/dep.h" | 30 #include "sandbox/src/dep.h" |
| 31 #include "sandbox/src/sandbox_factory.h" | 31 #include "sandbox/src/sandbox_factory.h" |
| 32 #include "sandbox/src/sandbox_types.h" | 32 #include "sandbox/src/sandbox_types.h" |
| 33 #endif // defined(OS_WIN) | 33 #endif // defined(OS_WIN) |
| 34 | 34 |
| 35 #if defined(OS_MACOSX) |
| 36 #include "chrome/browser/chrome_browser_application_mac.h" |
| 37 #endif // defined(OS_MACOSX) |
| 38 |
| 35 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
| 36 // The entry point signature of chrome.dll. | 40 // The entry point signature of chrome.dll. |
| 37 typedef int (*DLL_MAIN)(HINSTANCE, sandbox::SandboxInterfaceInfo*, wchar_t*); | 41 typedef int (*DLL_MAIN)(HINSTANCE, sandbox::SandboxInterfaceInfo*, wchar_t*); |
| 38 #endif // defined(OS_WIN) | 42 #endif // defined(OS_WIN) |
| 39 | 43 |
| 40 // Allows a specific test to increase its timeout. This should be used very | 44 // Allows a specific test to increase its timeout. This should be used very |
| 41 // sparingly, i.e. when a "test" is a really a collection of sub tests and it's | 45 // sparingly, i.e. when a "test" is a really a collection of sub tests and it's |
| 42 // not possible to break them up. An example is PDFBrowserTest.Loading, which | 46 // not possible to break them up. An example is PDFBrowserTest.Loading, which |
| 43 // loads all the files it can find in a directory. | 47 // loads all the files it can find in a directory. |
| 44 base::hash_map<std::string, int> g_test_timeout_overrides; | 48 base::hash_map<std::string, int> g_test_timeout_overrides; |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 " will be forcefully terminated.\n" | 451 " will be forcefully terminated.\n" |
| 448 " --help\n" | 452 " --help\n" |
| 449 " Shows this message.\n" | 453 " Shows this message.\n" |
| 450 " --gtest_help\n" | 454 " --gtest_help\n" |
| 451 " Shows the gtest help message.\n"); | 455 " Shows the gtest help message.\n"); |
| 452 } | 456 } |
| 453 | 457 |
| 454 } // namespace | 458 } // namespace |
| 455 | 459 |
| 456 int main(int argc, char** argv) { | 460 int main(int argc, char** argv) { |
| 461 #if defined(OS_MACOSX) |
| 462 chrome_browser_application_mac::RegisterBrowserCrApp(); |
| 463 #endif |
| 464 |
| 457 CommandLine::Init(argc, argv); | 465 CommandLine::Init(argc, argv); |
| 458 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 466 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 459 | 467 |
| 460 if (command_line->HasSwitch(kHelpFlag)) { | 468 if (command_line->HasSwitch(kHelpFlag)) { |
| 461 PrintUsage(); | 469 PrintUsage(); |
| 462 return 0; | 470 return 0; |
| 463 } | 471 } |
| 464 | 472 |
| 465 // TODO(pkasting): This "single_process vs. single-process" design is terrible | 473 // TODO(pkasting): This "single_process vs. single-process" design is terrible |
| 466 // UI. Instead, there should be some sort of signal flag on the command line, | 474 // UI. Instead, there should be some sort of signal flag on the command line, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 exit_code = 1; | 537 exit_code = 1; |
| 530 break; | 538 break; |
| 531 } | 539 } |
| 532 | 540 |
| 533 // Special value "-1" means "repeat indefinitely". | 541 // Special value "-1" means "repeat indefinitely". |
| 534 if (cycles != -1) | 542 if (cycles != -1) |
| 535 cycles--; | 543 cycles--; |
| 536 } | 544 } |
| 537 return exit_code; | 545 return exit_code; |
| 538 } | 546 } |
| OLD | NEW |