OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop.h" |
6 #include "base/scoped_nsobject.h" | 6 #include "base/scoped_nsobject.h" |
7 #include "chrome/browser/extensions/extension_pref_store.h" | 7 #include "chrome/browser/extensions/extension_pref_store.h" |
8 #include "chrome/browser/extensions/extension_prefs.h" | 8 #include "chrome/browser/extensions/extension_prefs.h" |
9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
11 #include "chrome/browser/ui/cocoa/browser_test_helper.h" | 11 #include "chrome/browser/ui/cocoa/browser_test_helper.h" |
12 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 12 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
13 #include "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" | 13 #include "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" |
14 #include "chrome/test/testing_profile.h" | 14 #include "chrome/test/testing_profile.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class ExtensionTestingProfile : public TestingProfile { | 18 class ExtensionTestingProfile : public TestingProfile { |
19 public: | 19 public: |
20 ExtensionTestingProfile() {} | 20 ExtensionTestingProfile() {} |
21 | 21 |
22 FilePath GetExtensionsInstallDir() { | 22 FilePath GetExtensionsInstallDir() { |
23 return GetPath().AppendASCII(ExtensionService::kInstallDirectoryName); | 23 return GetPath().AppendASCII(ExtensionService::kInstallDirectoryName); |
24 } | 24 } |
25 | 25 |
26 void InitExtensionProfile() { | 26 void InitExtensionProfile() { |
27 DCHECK(!GetExtensionProcessManager()); | 27 DCHECK(!GetExtensionProcessManager()); |
28 DCHECK(!GetExtensionService()); | 28 DCHECK(!GetExtensionService()); |
29 | 29 |
30 manager_.reset(ExtensionProcessManager::Create(this)); | 30 manager_.reset(ExtensionProcessManager::Create(this)); |
31 ExtensionPrefStore* pref_store = new ExtensionPrefStore; | 31 ExtensionPrefStore* pref_store = new ExtensionPrefStore(false); |
32 extension_prefs_.reset(new ExtensionPrefs(GetPrefs(), | 32 extension_prefs_.reset(new ExtensionPrefs(GetPrefs(), |
33 GetExtensionsInstallDir(), | 33 GetExtensionsInstallDir(), |
34 pref_store)); | 34 pref_store, |
| 35 NULL)); |
35 service_ = new ExtensionService(this, | 36 service_ = new ExtensionService(this, |
36 CommandLine::ForCurrentProcess(), | 37 CommandLine::ForCurrentProcess(), |
37 GetExtensionsInstallDir(), | 38 GetExtensionsInstallDir(), |
38 extension_prefs_.get(), | 39 extension_prefs_.get(), |
39 false); | 40 false); |
40 service_->set_extensions_enabled(true); | 41 service_->set_extensions_enabled(true); |
41 service_->set_show_extensions_prompts(false); | 42 service_->set_show_extensions_prompts(false); |
42 service_->ClearProvidersForTesting(); | 43 service_->ClearProvidersForTesting(); |
43 service_->Init(); | 44 service_->Init(); |
44 } | 45 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 }; | 91 }; |
91 | 92 |
92 TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) { | 93 TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) { |
93 // TODO(andybons): Better mechanisms for mocking out the extensions service | 94 // TODO(andybons): Better mechanisms for mocking out the extensions service |
94 // and extensions for easy testing need to be implemented. | 95 // and extensions for easy testing need to be implemented. |
95 // http://crbug.com/28316 | 96 // http://crbug.com/28316 |
96 EXPECT_TRUE([ExtensionPopupController popup]); | 97 EXPECT_TRUE([ExtensionPopupController popup]); |
97 } | 98 } |
98 | 99 |
99 } // namespace | 100 } // namespace |
OLD | NEW |