Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Side by Side Diff: chrome/browser/extensions/extension_startup_browsertest.cc

Issue 12212047: Linux/ChromeOS Chromium style checker cleanup, chrome/browser/extensions edition. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698