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/scoped_nsobject.h" | 5 #include "base/scoped_nsobject.h" |
6 #include "chrome/browser/cocoa/browser_test_helper.h" | 6 #include "chrome/browser/cocoa/browser_test_helper.h" |
7 #include "chrome/browser/cocoa/cocoa_test_helper.h" | 7 #include "chrome/browser/cocoa/cocoa_test_helper.h" |
8 #include "chrome/browser/cocoa/extensions/extension_popup_controller.h" | 8 #include "chrome/browser/cocoa/extensions/extension_popup_controller.h" |
9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
10 #include "chrome/browser/extensions/extensions_service.h" | 10 #include "chrome/browser/extensions/extensions_service.h" |
11 #include "chrome/test/testing_profile.h" | 11 #include "chrome/test/testing_profile.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class ExtensionTestingProfile : public TestingProfile { | 15 class ExtensionTestingProfile : public TestingProfile { |
16 public: | 16 public: |
17 ExtensionTestingProfile() {} | 17 ExtensionTestingProfile() {} |
18 | 18 |
19 FilePath GetExtensionsInstallDir() { | 19 FilePath GetExtensionsInstallDir() { |
20 return GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName); | 20 return GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName); |
21 } | 21 } |
22 | 22 |
23 void InitExtensionProfile() { | 23 void InitExtensionProfile() { |
24 DCHECK(!GetExtensionProcessManager()); | 24 DCHECK(!GetExtensionProcessManager()); |
25 DCHECK(!GetExtensionsService()); | 25 DCHECK(!GetExtensionsService()); |
26 | 26 |
27 manager_.reset(ExtensionProcessManager::Create(this)); | 27 manager_.reset(ExtensionProcessManager::Create(this)); |
28 service_ = new ExtensionsService(this, | 28 service_ = new ExtensionsService(this, |
29 CommandLine::ForCurrentProcess(), | 29 CommandLine::ForCurrentProcess(), |
30 GetPrefs(), | 30 GetExtensionsInstallDir(), |
31 GetExtensionsInstallDir(), | |
32 false); | 31 false); |
33 service_->set_extensions_enabled(true); | 32 service_->set_extensions_enabled(true); |
34 service_->set_show_extensions_prompts(false); | 33 service_->set_show_extensions_prompts(false); |
35 service_->ClearProvidersForTesting(); | 34 service_->ClearProvidersForTesting(); |
36 service_->Init(); | 35 service_->Init(); |
37 } | 36 } |
38 | 37 |
39 void ShutdownExtensionProfile() { | 38 void ShutdownExtensionProfile() { |
40 manager_.reset(); | 39 manager_.reset(); |
41 service_ = NULL; | 40 service_ = NULL; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 }; | 80 }; |
82 | 81 |
83 TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) { | 82 TEST_F(ExtensionPopupControllerTest, DISABLED_Basics) { |
84 // TODO(andybons): Better mechanisms for mocking out the extensions service | 83 // TODO(andybons): Better mechanisms for mocking out the extensions service |
85 // and extensions for easy testing need to be implemented. | 84 // and extensions for easy testing need to be implemented. |
86 // http://crbug.com/28316 | 85 // http://crbug.com/28316 |
87 EXPECT_TRUE([ExtensionPopupController popup]); | 86 EXPECT_TRUE([ExtensionPopupController popup]); |
88 } | 87 } |
89 | 88 |
90 } // namespace | 89 } // namespace |
OLD | NEW |