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_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 class ExtensionStartupTestBase : public InProcessBrowserTest { | 37 class ExtensionStartupTestBase : public InProcessBrowserTest { |
38 public: | 38 public: |
39 ExtensionStartupTestBase() : | 39 ExtensionStartupTestBase() : |
40 enable_extensions_(false), | 40 enable_extensions_(false), |
41 override_sideload_wipeout_(FeatureSwitch::sideload_wipeout(), false) { | 41 override_sideload_wipeout_(FeatureSwitch::sideload_wipeout(), false) { |
42 num_expected_extensions_ = 3; | 42 num_expected_extensions_ = 3; |
43 } | 43 } |
44 | 44 |
45 protected: | 45 protected: |
46 // InProcessBrowserTest | 46 // InProcessBrowserTest |
47 virtual void SetUpCommandLine(CommandLine* command_line) { | 47 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
48 if (!enable_extensions_) | 48 if (!enable_extensions_) |
49 command_line->AppendSwitch(switches::kDisableExtensions); | 49 command_line->AppendSwitch(switches::kDisableExtensions); |
50 | 50 |
51 if (!load_extensions_.empty()) { | 51 if (!load_extensions_.empty()) { |
52 FilePath::StringType paths = JoinString(load_extensions_, ','); | 52 FilePath::StringType paths = JoinString(load_extensions_, ','); |
53 command_line->AppendSwitchNative(switches::kLoadExtension, | 53 command_line->AppendSwitchNative(switches::kLoadExtension, |
54 paths); | 54 paths); |
55 command_line->AppendSwitch(switches::kDisableExtensionsFileAccessCheck); | 55 command_line->AppendSwitch(switches::kDisableExtensionsFileAccessCheck); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 virtual bool SetUpUserDataDirectory() { | 59 virtual bool SetUpUserDataDirectory() OVERRIDE { |
60 FilePath profile_dir; | 60 FilePath profile_dir; |
61 PathService::Get(chrome::DIR_USER_DATA, &profile_dir); | 61 PathService::Get(chrome::DIR_USER_DATA, &profile_dir); |
62 profile_dir = profile_dir.AppendASCII(TestingProfile::kTestUserProfileDir); | 62 profile_dir = profile_dir.AppendASCII(TestingProfile::kTestUserProfileDir); |
63 file_util::CreateDirectory(profile_dir); | 63 file_util::CreateDirectory(profile_dir); |
64 | 64 |
65 preferences_file_ = profile_dir.AppendASCII("Preferences"); | 65 preferences_file_ = profile_dir.AppendASCII("Preferences"); |
66 user_scripts_dir_ = profile_dir.AppendASCII("User Scripts"); | 66 user_scripts_dir_ = profile_dir.AppendASCII("User Scripts"); |
67 extensions_dir_ = profile_dir.AppendASCII("Extensions"); | 67 extensions_dir_ = profile_dir.AppendASCII("Extensions"); |
68 | 68 |
69 if (enable_extensions_ && load_extensions_.empty()) { | 69 if (enable_extensions_ && load_extensions_.empty()) { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 .AppendASCII("extensions") | 273 .AppendASCII("extensions") |
274 .AppendASCII("app2"); | 274 .AppendASCII("app2"); |
275 load_extensions_.push_back(fourth_extension_path.value()); | 275 load_extensions_.push_back(fourth_extension_path.value()); |
276 } | 276 } |
277 }; | 277 }; |
278 | 278 |
279 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 279 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
280 WaitForServicesToStart(4, true); | 280 WaitForServicesToStart(4, true); |
281 TestInjection(true, true); | 281 TestInjection(true, true); |
282 } | 282 } |
OLD | NEW |