Chromium Code Reviews| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 // The environment variable name for the test shard index. | 46 // The environment variable name for the test shard index. |
| 47 const char kTestShardIndex[] = "GTEST_SHARD_INDEX"; | 47 const char kTestShardIndex[] = "GTEST_SHARD_INDEX"; |
| 48 | 48 |
| 49 // The default output file for XML output. | 49 // The default output file for XML output. |
| 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"; |
|
mmenke
2012/06/29 20:11:58
Kinda weird to still have this here, though gettin
| |
| 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 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 662 } | 655 } |
| 663 | 656 |
| 664 // Special value "-1" means "repeat indefinitely". | 657 // Special value "-1" means "repeat indefinitely". |
| 665 if (cycles != -1) | 658 if (cycles != -1) |
| 666 cycles--; | 659 cycles--; |
| 667 } | 660 } |
| 668 return exit_code; | 661 return exit_code; |
| 669 } | 662 } |
| 670 | 663 |
| 671 } // namespace test_launcher | 664 } // namespace test_launcher |
| OLD | NEW |