| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // src_dir is set to the source directory | 226 // src_dir is set to the source directory |
| 227 // Output: | 227 // Output: |
| 228 // On success, modifies user_data_dir_ to be a new profile directory | 228 // On success, modifies user_data_dir_ to be a new profile directory |
| 229 // sets temp_dir_ to the containing temporary directory, | 229 // sets temp_dir_ to the containing temporary directory, |
| 230 // and sets cleanup_temp_dir_on_exit_ to true. | 230 // and sets cleanup_temp_dir_on_exit_ to true. |
| 231 bool SetupTempDirectory(const base::FilePath& src_dir) { | 231 bool SetupTempDirectory(const base::FilePath& src_dir) { |
| 232 VLOG(1) << "Setting up temp directory in " << src_dir.value(); | 232 VLOG(1) << "Setting up temp directory in " << src_dir.value(); |
| 233 // We create a copy of the test dir and use it so that each | 233 // We create a copy of the test dir and use it so that each |
| 234 // run of this test starts with the same data. Running this | 234 // run of this test starts with the same data. Running this |
| 235 // test has the side effect that it will change the profile. | 235 // test has the side effect that it will change the profile. |
| 236 if (!file_util::CreateNewTempDirectory(kTempDirName, &temp_dir_)) { | 236 if (!base::CreateNewTempDirectory(kTempDirName, &temp_dir_)) { |
| 237 LOG(ERROR) << "Could not create temp directory:" << kTempDirName; | 237 LOG(ERROR) << "Could not create temp directory:" << kTempDirName; |
| 238 return false; | 238 return false; |
| 239 } | 239 } |
| 240 | 240 |
| 241 if (!base::CopyDirectory(src_dir, temp_dir_, true)) { | 241 if (!base::CopyDirectory(src_dir, temp_dir_, true)) { |
| 242 LOG(ERROR) << "Could not copy temp directory"; | 242 LOG(ERROR) << "Could not copy temp directory"; |
| 243 return false; | 243 return false; |
| 244 } | 244 } |
| 245 | 245 |
| 246 // The profile directory was copied in to the containing temp | 246 // The profile directory was copied in to the containing temp |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 GENERAL_MIX_MEMORY_TESTS(SingleTabTest, 1); | 526 GENERAL_MIX_MEMORY_TESTS(SingleTabTest, 1); |
| 527 GENERAL_MIX_MEMORY_TESTS(FiveTabTest, 5); | 527 GENERAL_MIX_MEMORY_TESTS(FiveTabTest, 5); |
| 528 GENERAL_MIX_MEMORY_TESTS(TwelveTabTest, 12); | 528 GENERAL_MIX_MEMORY_TESTS(TwelveTabTest, 12); |
| 529 | 529 |
| 530 // Commented out until the recorded cache data is added. | 530 // Commented out until the recorded cache data is added. |
| 531 //TEST_F(MembusterMemoryTest, Windows) { | 531 //TEST_F(MembusterMemoryTest, Windows) { |
| 532 // RunTest("membuster", 0); | 532 // RunTest("membuster", 0); |
| 533 //} | 533 //} |
| 534 | 534 |
| 535 } // namespace | 535 } // namespace |
| OLD | NEW |