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

Side by Side Diff: extensions/browser/extensions_test.cc

Issue 899553002: Make MockExtensionSystemFactory available in all ExtensionsTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « extensions/browser/extensions_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extensions_test.h" 5 #include "extensions/browser/extensions_test.h"
6 6
7 #include "components/keyed_service/content/browser_context_dependency_manager.h" 7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "content/public/browser/content_browser_client.h" 8 #include "content/public/browser/content_browser_client.h"
9 #include "content/public/common/content_client.h" 9 #include "content/public/common/content_client.h"
10 #include "content/public/test/test_browser_context.h" 10 #include "content/public/test/test_browser_context.h"
(...skipping 14 matching lines...) Expand all
25 : content_client_(new content::ContentClient), 25 : content_client_(new content::ContentClient),
26 content_utility_client_(new TestContentUtilityClient), 26 content_utility_client_(new TestContentUtilityClient),
27 content_browser_client_(new content::ContentBrowserClient), 27 content_browser_client_(new content::ContentBrowserClient),
28 browser_context_(new content::TestBrowserContext), 28 browser_context_(new content::TestBrowserContext),
29 extensions_browser_client_( 29 extensions_browser_client_(
30 new TestExtensionsBrowserClient(browser_context_.get())) { 30 new TestExtensionsBrowserClient(browser_context_.get())) {
31 content::SetContentClient(content_client_.get()); 31 content::SetContentClient(content_client_.get());
32 content::SetUtilityClientForTesting(content_utility_client_.get()); 32 content::SetUtilityClientForTesting(content_utility_client_.get());
33 content::SetBrowserClientForTesting(content_browser_client_.get()); 33 content::SetBrowserClientForTesting(content_browser_client_.get());
34 ExtensionsBrowserClient::Set(extensions_browser_client_.get()); 34 ExtensionsBrowserClient::Set(extensions_browser_client_.get());
35 extensions_browser_client_->set_extension_system_factory(
36 &extension_system_factory_);
35 } 37 }
36 38
37 ExtensionsTest::~ExtensionsTest() { 39 ExtensionsTest::~ExtensionsTest() {
38 ExtensionsBrowserClient::Set(NULL); 40 ExtensionsBrowserClient::Set(NULL);
39 content::SetBrowserClientForTesting(NULL); 41 content::SetBrowserClientForTesting(NULL);
40 content::SetUtilityClientForTesting(NULL); 42 content::SetUtilityClientForTesting(NULL);
41 content::SetContentClient(NULL); 43 content::SetContentClient(NULL);
42 } 44 }
43 45
44 void ExtensionsTest::SetUp() { 46 void ExtensionsTest::SetUp() {
45 // Crashing here? Don't use this class in Chrome's unit_tests. See header. 47 // Crashing here? Don't use this class in Chrome's unit_tests. See header.
46 BrowserContextDependencyManager::GetInstance() 48 BrowserContextDependencyManager::GetInstance()
47 ->CreateBrowserContextServicesForTest(browser_context_.get()); 49 ->CreateBrowserContextServicesForTest(browser_context_.get());
48 } 50 }
49 51
50 void ExtensionsTest::TearDown() { 52 void ExtensionsTest::TearDown() {
51 // Allows individual tests to have BrowserContextKeyedServiceFactory objects 53 // Allows individual tests to have BrowserContextKeyedServiceFactory objects
52 // as member variables instead of singletons. The individual services will be 54 // as member variables instead of singletons. The individual services will be
53 // cleaned up before the factories are destroyed. 55 // cleaned up before the factories are destroyed.
54 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( 56 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
55 browser_context_.get()); 57 browser_context_.get());
56 } 58 }
57 59
58 } // namespace extensions 60 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extensions_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698