| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 file_util::CopyFile(src_dir.AppendASCII("Preferences"), | 73 file_util::CopyFile(src_dir.AppendASCII("Preferences"), |
| 74 preferences_file_); | 74 preferences_file_); |
| 75 file_util::CopyDirectory(src_dir.AppendASCII("Extensions"), | 75 file_util::CopyDirectory(src_dir.AppendASCII("Extensions"), |
| 76 profile_dir, true); // recursive | 76 profile_dir, true); // recursive |
| 77 } | 77 } |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 virtual void TearDown() { | 81 virtual void TearDown() { |
| 82 EXPECT_TRUE(file_util::Delete(preferences_file_, false)); | 82 EXPECT_TRUE(base::Delete(preferences_file_, false)); |
| 83 | 83 |
| 84 // TODO(phajdan.jr): Check return values of the functions below, carefully. | 84 // TODO(phajdan.jr): Check return values of the functions below, carefully. |
| 85 file_util::Delete(user_scripts_dir_, true); | 85 base::Delete(user_scripts_dir_, true); |
| 86 file_util::Delete(extensions_dir_, true); | 86 base::Delete(extensions_dir_, true); |
| 87 | 87 |
| 88 InProcessBrowserTest::TearDown(); | 88 InProcessBrowserTest::TearDown(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void WaitForServicesToStart(int num_expected_extensions, | 91 void WaitForServicesToStart(int num_expected_extensions, |
| 92 bool expect_extensions_enabled) { | 92 bool expect_extensions_enabled) { |
| 93 ExtensionService* service = extensions::ExtensionSystem::Get( | 93 ExtensionService* service = extensions::ExtensionSystem::Get( |
| 94 browser()->profile())->extension_service(); | 94 browser()->profile())->extension_service(); |
| 95 | 95 |
| 96 // Count the number of non-component extensions. | 96 // Count the number of non-component extensions. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 .AppendASCII("extensions") | 269 .AppendASCII("extensions") |
| 270 .AppendASCII("app2"); | 270 .AppendASCII("app2"); |
| 271 load_extensions_.push_back(fourth_extension_path.value()); | 271 load_extensions_.push_back(fourth_extension_path.value()); |
| 272 } | 272 } |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 275 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
| 276 WaitForServicesToStart(4, true); | 276 WaitForServicesToStart(4, true); |
| 277 TestInjection(true, true); | 277 TestInjection(true, true); |
| 278 } | 278 } |
| OLD | NEW |