| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const FilePath::CharType kDefaultOutputFile[] = FILE_PATH_LITERAL( | 50 const FilePath::CharType kDefaultOutputFile[] = FILE_PATH_LITERAL( |
| 51 "test_detail.xml"); | 51 "test_detail.xml"); |
| 52 | 52 |
| 53 // Quit test execution after this number of tests has timed out. | 53 // Quit test execution after this number of tests has timed out. |
| 54 const int kMaxTimeouts = 5; // 45s timeout * (5 + 1) = 270s max run time. | 54 const int kMaxTimeouts = 5; // 45s timeout * (5 + 1) = 270s max run time. |
| 55 | 55 |
| 56 const char kEmptyTestName[] = "InProcessBrowserTest.Empty"; | 56 const char kEmptyTestName[] = "InProcessBrowserTest.Empty"; |
| 57 | 57 |
| 58 namespace { | 58 namespace { |
| 59 | 59 |
| 60 #if defined(IN_PROC_BROWSER_TEST_F) | |
| 61 // An empty test (it starts up and shuts down the browser as part of its | |
| 62 // setup and teardown) used to prefetch all of the browser code into memory. | |
| 63 IN_PROC_BROWSER_TEST_F(InProcessBrowserTest, Empty) { | |
| 64 } | |
| 65 #endif | |
| 66 | |
| 67 // Parses the environment variable var as an Int32. If it is unset, returns | 60 // Parses the environment variable var as an Int32. If it is unset, returns |
| 68 // default_val. If it is set, unsets it then converts it to Int32 before | 61 // default_val. If it is set, unsets it then converts it to Int32 before |
| 69 // returning it. If unsetting or converting to an Int32 fails, print an | 62 // returning it. If unsetting or converting to an Int32 fails, print an |
| 70 // error and exit with failure. | 63 // error and exit with failure. |
| 71 int32 Int32FromEnvOrDie(const char* const var, int32 default_val) { | 64 int32 Int32FromEnvOrDie(const char* const var, int32 default_val) { |
| 72 scoped_ptr<base::Environment> env(base::Environment::Create()); | 65 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 73 std::string str_val; | 66 std::string str_val; |
| 74 int32 result; | 67 int32 result; |
| 75 if (!env->GetVar(var, &str_val)) | 68 if (!env->GetVar(var, &str_val)) |
| 76 return default_val; | 69 return default_val; |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 } | 659 } |
| 667 | 660 |
| 668 // Special value "-1" means "repeat indefinitely". | 661 // Special value "-1" means "repeat indefinitely". |
| 669 if (cycles != -1) | 662 if (cycles != -1) |
| 670 cycles--; | 663 cycles--; |
| 671 } | 664 } |
| 672 return exit_code; | 665 return exit_code; |
| 673 } | 666 } |
| 674 | 667 |
| 675 } // namespace test_launcher | 668 } // namespace test_launcher |
| OLD | NEW |