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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_popup_controller_unittest.mm

Issue 5646003: Sanitize PrefStore interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix PrefService mock construction in PrefServiceTest to include command line store. Created 10 years 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
« no previous file with comments | « chrome/browser/search_engines/template_url_model_unittest.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/message_loop.h"
5 #include "base/scoped_nsobject.h" 6 #include "base/scoped_nsobject.h"
7 #include "chrome/browser/extensions/extension_pref_store.h"
6 #include "chrome/browser/extensions/extension_prefs.h" 8 #include "chrome/browser/extensions/extension_prefs.h"
7 #include "chrome/browser/extensions/extension_process_manager.h" 9 #include "chrome/browser/extensions/extension_process_manager.h"
8 #include "chrome/browser/extensions/extensions_service.h" 10 #include "chrome/browser/extensions/extensions_service.h"
9 #include "chrome/browser/ui/cocoa/browser_test_helper.h" 11 #include "chrome/browser/ui/cocoa/browser_test_helper.h"
10 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" 12 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
11 #include "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" 13 #include "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h"
12 #include "chrome/test/testing_profile.h" 14 #include "chrome/test/testing_profile.h"
13 15
14 namespace { 16 namespace {
15 17
16 class ExtensionTestingProfile : public TestingProfile { 18 class ExtensionTestingProfile : public TestingProfile {
17 public: 19 public:
18 ExtensionTestingProfile() {} 20 ExtensionTestingProfile() {}
19 21
20 FilePath GetExtensionsInstallDir() { 22 FilePath GetExtensionsInstallDir() {
21 return GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName); 23 return GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName);
22 } 24 }
23 25
24 void InitExtensionProfile() { 26 void InitExtensionProfile() {
25 DCHECK(!GetExtensionProcessManager()); 27 DCHECK(!GetExtensionProcessManager());
26 DCHECK(!GetExtensionsService()); 28 DCHECK(!GetExtensionsService());
27 29
28 manager_.reset(ExtensionProcessManager::Create(this)); 30 manager_.reset(ExtensionProcessManager::Create(this));
31 ExtensionPrefStore* pref_store = new ExtensionPrefStore;
29 extension_prefs_.reset(new ExtensionPrefs(GetPrefs(), 32 extension_prefs_.reset(new ExtensionPrefs(GetPrefs(),
30 GetExtensionsInstallDir())); 33 GetExtensionsInstallDir(),
34 pref_store));
31 service_ = new ExtensionsService(this, 35 service_ = new ExtensionsService(this,
32 CommandLine::ForCurrentProcess(), 36 CommandLine::ForCurrentProcess(),
33 GetExtensionsInstallDir(), 37 GetExtensionsInstallDir(),
34 extension_prefs_.get(), 38 extension_prefs_.get(),
35 false); 39 false);
36 service_->set_extensions_enabled(true); 40 service_->set_extensions_enabled(true);
37 service_->set_show_extensions_prompts(false); 41 service_->set_show_extensions_prompts(false);
38 service_->ClearProvidersForTesting(); 42 service_->ClearProvidersForTesting();
39 service_->Init(); 43 service_->Init();
40 } 44 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 }; 90 };
87 91
88 TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) { 92 TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) {
89 // TODO(andybons): Better mechanisms for mocking out the extensions service 93 // TODO(andybons): Better mechanisms for mocking out the extensions service
90 // and extensions for easy testing need to be implemented. 94 // and extensions for easy testing need to be implemented.
91 // http://crbug.com/28316 95 // http://crbug.com/28316
92 EXPECT_TRUE([ExtensionPopupController popup]); 96 EXPECT_TRUE([ExtensionPopupController popup]);
93 } 97 }
94 98
95 } // namespace 99 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/search_engines/template_url_model_unittest.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698