Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/test/startup/shutdown_test.cc

Issue 3029062: base: rename Environment::GetEnv to Environment::GetVar. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/plugin/plugin_main_mac.mm ('k') | chrome/test/startup/startup_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::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->GetEnv(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 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 "
84 << kNumCyclesMax; 84 << kNumCyclesMax;
85 numCycles = kNumCyclesMax; 85 numCycles = kNumCyclesMax;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/plugin/plugin_main_mac.mm ('k') | chrome/test/startup/startup_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698