OLD | NEW |
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 Loading... |
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 |
OLD | NEW |