| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 preferences_file_ = profile_dir.AppendASCII("Preferences"); | 64 preferences_file_ = profile_dir.AppendASCII("Preferences"); |
| 65 user_scripts_dir_ = profile_dir.AppendASCII("User Scripts"); | 65 user_scripts_dir_ = profile_dir.AppendASCII("User Scripts"); |
| 66 extensions_dir_ = profile_dir.AppendASCII("Extensions"); | 66 extensions_dir_ = profile_dir.AppendASCII("Extensions"); |
| 67 | 67 |
| 68 if (enable_extensions_ && load_extensions_.empty()) { | 68 if (enable_extensions_ && load_extensions_.empty()) { |
| 69 base::FilePath src_dir; | 69 base::FilePath src_dir; |
| 70 PathService::Get(chrome::DIR_TEST_DATA, &src_dir); | 70 PathService::Get(chrome::DIR_TEST_DATA, &src_dir); |
| 71 src_dir = src_dir.AppendASCII("extensions").AppendASCII("good"); | 71 src_dir = src_dir.AppendASCII("extensions").AppendASCII("good"); |
| 72 | 72 |
| 73 file_util::CopyFile(src_dir.AppendASCII("Preferences"), | 73 base::CopyFile(src_dir.AppendASCII("Preferences"), preferences_file_); |
| 74 preferences_file_); | 74 base::CopyDirectory(src_dir.AppendASCII("Extensions"), |
| 75 file_util::CopyDirectory(src_dir.AppendASCII("Extensions"), | 75 profile_dir, true); // recursive |
| 76 profile_dir, true); // recursive | |
| 77 } | 76 } |
| 78 return true; | 77 return true; |
| 79 } | 78 } |
| 80 | 79 |
| 81 virtual void TearDown() { | 80 virtual void TearDown() { |
| 82 EXPECT_TRUE(base::Delete(preferences_file_, false)); | 81 EXPECT_TRUE(base::Delete(preferences_file_, false)); |
| 83 | 82 |
| 84 // TODO(phajdan.jr): Check return values of the functions below, carefully. | 83 // TODO(phajdan.jr): Check return values of the functions below, carefully. |
| 85 base::Delete(user_scripts_dir_, true); | 84 base::Delete(user_scripts_dir_, true); |
| 86 base::Delete(extensions_dir_, true); | 85 base::Delete(extensions_dir_, true); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 .AppendASCII("extensions") | 268 .AppendASCII("extensions") |
| 270 .AppendASCII("app2"); | 269 .AppendASCII("app2"); |
| 271 load_extensions_.push_back(fourth_extension_path.value()); | 270 load_extensions_.push_back(fourth_extension_path.value()); |
| 272 } | 271 } |
| 273 }; | 272 }; |
| 274 | 273 |
| 275 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 274 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
| 276 WaitForServicesToStart(4, true); | 275 WaitForServicesToStart(4, true); |
| 277 TestInjection(true, true); | 276 TestInjection(true, true); |
| 278 } | 277 } |
| OLD | NEW |