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