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

Unified Diff: extensions/browser/extensions_test_browser_context.cc

Issue 355223002: Add ExtensionsTestBrowserContext class for test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/extensions_test_browser_context.h ('k') | extensions/browser/image_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extensions_test_browser_context.cc
diff --git a/extensions/browser/extensions_test_browser_context.cc b/extensions/browser/extensions_test_browser_context.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eae98fb09dbf4283375f6c514770894bbebbbe55
--- /dev/null
+++ b/extensions/browser/extensions_test_browser_context.cc
@@ -0,0 +1,25 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "extensions/browser/extensions_test_browser_context.h"
+
+#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "extensions/browser/extensions_browser_client.h"
+#include "extensions/browser/test_extensions_browser_client.h"
+
+namespace extensions {
+
+ExtensionsTestBrowserContext::ExtensionsTestBrowserContext() {
+ BrowserContextDependencyManager::GetInstance()
+ ->CreateBrowserContextServicesForTest(this);
+ ExtensionsBrowserClient::Set(new TestExtensionsBrowserClient(this));
Yoyo Zhou 2014/07/18 01:47:13 It looks like this is leaked. Can you mean the Tes
limasdf 2014/07/18 02:22:25 This is necessary because from the ChromeExtension
Yoyo Zhou 2014/07/18 02:38:45 Sorry, I meant to write "make" instead of "mean" a
limasdf 2014/07/18 06:48:12 Done. Yes exactly, there was a leak. Fixed.
+}
+
+ExtensionsTestBrowserContext::~ExtensionsTestBrowserContext() {
+ BrowserContextDependencyManager::GetInstance()
+ ->DestroyBrowserContextServices(this);
+ ExtensionsBrowserClient::Set(NULL);
+}
+
+} // namespace extensions
« no previous file with comments | « extensions/browser/extensions_test_browser_context.h ('k') | extensions/browser/image_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698