OLD | NEW |
1 // Copyright (c) 2006-2009 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 private: | 237 private: |
238 // Setup a temporary directory to store the profile to use | 238 // Setup a temporary directory to store the profile to use |
239 // with these tests. | 239 // with these tests. |
240 // Input: | 240 // Input: |
241 // src_dir is set to the source directory | 241 // src_dir is set to the source directory |
242 // Output: | 242 // Output: |
243 // On success, modifies user_data_dir_ to be a new profile directory | 243 // On success, modifies user_data_dir_ to be a new profile directory |
244 // sets temp_dir_ to the containing temporary directory, | 244 // sets temp_dir_ to the containing temporary directory, |
245 // and sets cleanup_temp_dir_on_exit_ to true. | 245 // and sets cleanup_temp_dir_on_exit_ to true. |
246 bool SetupTempDirectory(const FilePath& src_dir) { | 246 bool SetupTempDirectory(const FilePath& src_dir) { |
247 LOG(INFO) << "Setting up temp directory in " << src_dir.value(); | 247 VLOG(1) << "Setting up temp directory in " << src_dir.value(); |
248 // We create a copy of the test dir and use it so that each | 248 // We create a copy of the test dir and use it so that each |
249 // run of this test starts with the same data. Running this | 249 // run of this test starts with the same data. Running this |
250 // test has the side effect that it will change the profile. | 250 // test has the side effect that it will change the profile. |
251 if (!file_util::CreateNewTempDirectory(kTempDirName, &temp_dir_)) { | 251 if (!file_util::CreateNewTempDirectory(kTempDirName, &temp_dir_)) { |
252 LOG(ERROR) << "Could not create temp directory:" << kTempDirName; | 252 LOG(ERROR) << "Could not create temp directory:" << kTempDirName; |
253 return false; | 253 return false; |
254 } | 254 } |
255 | 255 |
256 if (!file_util::CopyDirectory(src_dir, temp_dir_, true)) { | 256 if (!file_util::CopyDirectory(src_dir, temp_dir_, true)) { |
257 LOG(ERROR) << "Could not copy temp directory"; | 257 LOG(ERROR) << "Could not copy temp directory"; |
258 return false; | 258 return false; |
259 } | 259 } |
260 | 260 |
261 // The profile directory was copied in to the containing temp | 261 // The profile directory was copied in to the containing temp |
262 // directory as its base name, so point user_data_dir_ there. | 262 // directory as its base name, so point user_data_dir_ there. |
263 user_data_dir_ = temp_dir_.Append(src_dir.BaseName()); | 263 user_data_dir_ = temp_dir_.Append(src_dir.BaseName()); |
264 cleanup_temp_dir_on_exit_ = true; | 264 cleanup_temp_dir_on_exit_ = true; |
265 LOG(INFO) << "Finished temp directory setup."; | 265 VLOG(1) << "Finished temp directory setup."; |
266 return true; | 266 return true; |
267 } | 267 } |
268 | 268 |
269 bool cleanup_temp_dir_on_exit_; | 269 bool cleanup_temp_dir_on_exit_; |
270 FilePath temp_dir_; | 270 FilePath temp_dir_; |
271 FilePath user_data_dir_; | 271 FilePath user_data_dir_; |
272 }; | 272 }; |
273 | 273 |
274 class GeneralMixMemoryTest : public MemoryTest { | 274 class GeneralMixMemoryTest : public MemoryTest { |
275 public: | 275 public: |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 TEST_F(GeneralMixMemoryTest, MAYBE_TwelveTabTest) { | 541 TEST_F(GeneralMixMemoryTest, MAYBE_TwelveTabTest) { |
542 RunTest("_12t", 12); | 542 RunTest("_12t", 12); |
543 } | 543 } |
544 | 544 |
545 // Commented out until the recorded cache data is added. | 545 // Commented out until the recorded cache data is added. |
546 //TEST_F(MembusterMemoryTest, Windows) { | 546 //TEST_F(MembusterMemoryTest, Windows) { |
547 // RunTest("membuster", 0); | 547 // RunTest("membuster", 0); |
548 //} | 548 //} |
549 | 549 |
550 } // namespace | 550 } // namespace |
OLD | NEW |