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/environment.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" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::Environment> env(base::Environment::Create()); | 73 scoped_ptr<base::Environment> env(base::Environment::Create()); |
74 std::string numCyclesEnv; | 74 std::string numCyclesEnv; |
75 if (env->GetVar(env_vars::kStartupTestsNumCycles, &numCyclesEnv) && | 75 if (env->GetVar(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 VLOG(1) << env_vars::kStartupTestsNumCycles |
79 << " set in environment, so setting numCycles to " | 79 << " set in environment, so setting numCycles to " << numCycles; |
80 << numCycles; | |
81 } else { | 80 } else { |
82 LOG(INFO) << env_vars::kStartupTestsNumCycles | 81 VLOG(1) << env_vars::kStartupTestsNumCycles |
83 << " is higher than the max, setting numCycles to " | 82 << " is higher than the max, setting numCycles to " |
84 << kNumCyclesMax; | 83 << kNumCyclesMax; |
85 numCycles = kNumCyclesMax; | 84 numCycles = kNumCyclesMax; |
86 } | 85 } |
87 } | 86 } |
88 | 87 |
89 TimeDelta timings[kNumCyclesMax]; | 88 TimeDelta timings[kNumCyclesMax]; |
90 for (int i = 0; i < numCycles; ++i) { | 89 for (int i = 0; i < numCycles; ++i) { |
91 UITest::SetUp(); | 90 UITest::SetUp(); |
92 if (test_size == TWENTY_TABS) { | 91 if (test_size == TWENTY_TABS) { |
93 SetUpTwentyTabs(); | 92 SetUpTwentyTabs(); |
94 } | 93 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 #else | 154 #else |
156 #define MAYBE_TwentyTabsSessionEnding TwentyTabsSessionEnding | 155 #define MAYBE_TwentyTabsSessionEnding TwentyTabsSessionEnding |
157 #endif | 156 #endif |
158 | 157 |
159 TEST_F(ShutdownTest, MAYBE_TwentyTabsSessionEnding) { | 158 TEST_F(ShutdownTest, MAYBE_TwentyTabsSessionEnding) { |
160 RunShutdownTest("shutdown", "twentytabs-session-ending", | 159 RunShutdownTest("shutdown", "twentytabs-session-ending", |
161 true, /* important */ TWENTY_TABS, UITest::SESSION_ENDING); | 160 true, /* important */ TWENTY_TABS, UITest::SESSION_ENDING); |
162 } | 161 } |
163 | 162 |
164 } // namespace | 163 } // namespace |
OLD | NEW |