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

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

Issue 598173003: Run clang-modernize -use-nullptr over src/extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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_browser_client_(new content::ContentBrowserClient), 25 content_browser_client_(new content::ContentBrowserClient),
26 browser_context_(new content::TestBrowserContext), 26 browser_context_(new content::TestBrowserContext),
27 extensions_browser_client_( 27 extensions_browser_client_(
28 new TestExtensionsBrowserClient(browser_context_.get())) { 28 new TestExtensionsBrowserClient(browser_context_.get())) {
29 content::SetContentClient(content_client_.get()); 29 content::SetContentClient(content_client_.get());
30 content::SetBrowserClientForTesting(content_browser_client_.get()); 30 content::SetBrowserClientForTesting(content_browser_client_.get());
31 ExtensionsBrowserClient::Set(extensions_browser_client_.get()); 31 ExtensionsBrowserClient::Set(extensions_browser_client_.get());
32 } 32 }
33 33
34 ExtensionsTest::~ExtensionsTest() { 34 ExtensionsTest::~ExtensionsTest() {
35 ExtensionsBrowserClient::Set(NULL); 35 ExtensionsBrowserClient::Set(nullptr);
36 content::SetBrowserClientForTesting(NULL); 36 content::SetBrowserClientForTesting(nullptr);
37 content::SetContentClient(NULL); 37 content::SetContentClient(nullptr);
38 } 38 }
39 39
40 void ExtensionsTest::SetUp() { 40 void ExtensionsTest::SetUp() {
41 // Crashing here? Don't use this class in Chrome's unit_tests. See header. 41 // Crashing here? Don't use this class in Chrome's unit_tests. See header.
42 BrowserContextDependencyManager::GetInstance() 42 BrowserContextDependencyManager::GetInstance()
43 ->CreateBrowserContextServicesForTest(browser_context_.get()); 43 ->CreateBrowserContextServicesForTest(browser_context_.get());
44 } 44 }
45 45
46 void ExtensionsTest::TearDown() { 46 void ExtensionsTest::TearDown() {
47 // Allows individual tests to have BrowserContextKeyedServiceFactory objects 47 // Allows individual tests to have BrowserContextKeyedServiceFactory objects
48 // as member variables instead of singletons. The individual services will be 48 // as member variables instead of singletons. The individual services will be
49 // cleaned up before the factories are destroyed. 49 // cleaned up before the factories are destroyed.
50 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( 50 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
51 browser_context_.get()); 51 browser_context_.get());
52 } 52 }
53 53
54 } // namespace extensions 54 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698