| 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 "base/env_var.h" | 5 #include "base/environment.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
| 14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 net::FilePathToFileURL(test_cases[i]))); | 63 net::FilePathToFileURL(test_cases[i]))); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void RunShutdownTest(const char* graph, const char* trace, | 68 void RunShutdownTest(const char* graph, const char* trace, |
| 69 bool important, TestSize test_size, | 69 bool important, TestSize test_size, |
| 70 UITest::ShutdownType shutdown_type) { | 70 UITest::ShutdownType shutdown_type) { |
| 71 const int kNumCyclesMax = 20; | 71 const int kNumCyclesMax = 20; |
| 72 int numCycles = kNumCyclesMax; | 72 int numCycles = kNumCyclesMax; |
| 73 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); | 73 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 74 std::string numCyclesEnv; | 74 std::string numCyclesEnv; |
| 75 if (env->GetEnv(env_vars::kStartupTestsNumCycles, &numCyclesEnv) && | 75 if (env->GetEnv(env_vars::kStartupTestsNumCycles, &numCyclesEnv) && |
| 76 base::StringToInt(numCyclesEnv, &numCycles)) { | 76 base::StringToInt(numCyclesEnv, &numCycles)) { |
| 77 if (numCycles <= kNumCyclesMax) { | 77 if (numCycles <= kNumCyclesMax) { |
| 78 LOG(INFO) << env_vars::kStartupTestsNumCycles | 78 LOG(INFO) << env_vars::kStartupTestsNumCycles |
| 79 << " set in environment, so setting numCycles to " | 79 << " set in environment, so setting numCycles to " |
| 80 << numCycles; | 80 << numCycles; |
| 81 } else { | 81 } else { |
| 82 LOG(INFO) << env_vars::kStartupTestsNumCycles | 82 LOG(INFO) << env_vars::kStartupTestsNumCycles |
| 83 << " is higher than the max, setting numCycles to " | 83 << " is higher than the max, setting numCycles to " |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 #else | 144 #else |
| 145 #define MAYBE_TwentyTabsSessionEnding TwentyTabsSessionEnding | 145 #define MAYBE_TwentyTabsSessionEnding TwentyTabsSessionEnding |
| 146 #endif | 146 #endif |
| 147 | 147 |
| 148 TEST_F(ShutdownTest, MAYBE_TwentyTabsSessionEnding) { | 148 TEST_F(ShutdownTest, MAYBE_TwentyTabsSessionEnding) { |
| 149 RunShutdownTest("shutdown", "twentytabs-session-ending", | 149 RunShutdownTest("shutdown", "twentytabs-session-ending", |
| 150 true, /* important */ TWENTY_TABS, UITest::SESSION_ENDING); | 150 true, /* important */ TWENTY_TABS, UITest::SESSION_ENDING); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace | 153 } // namespace |
| OLD | NEW |