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

Unified Diff: extensions/browser/test_extensions_browser_client.h

Issue 1362043005: Add extensions code to use common updater in components/update_client/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use ConfiguratorImpl, change TestExtensionService, etc Created 5 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/test_extensions_browser_client.h
diff --git a/extensions/browser/test_extensions_browser_client.h b/extensions/browser/test_extensions_browser_client.h
index 86f0576555d348205f01707b96cbc744faeae7d7..5369830e09452d89c7d347a84a6be9a8b1981530 100644
--- a/extensions/browser/test_extensions_browser_client.h
+++ b/extensions/browser/test_extensions_browser_client.h
@@ -5,7 +5,13 @@
#ifndef EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_
#define EXTENSIONS_BROWSER_TEST_EXTENSIONS_BROWSER_CLIENT_H_
+#include <string>
+#include <vector>
+
+#include "base/callback.h"
#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
+#include "components/update_client/update_client.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/updater/extension_cache.h"
@@ -30,6 +36,10 @@ class TestExtensionsBrowserClient : public ExtensionsBrowserClient {
extension_cache_ = extension_cache.Pass();
}
+ // Sets a factory to respond to calls of the CreateUpdateClient method.
+ void SetUpdateClientFactory(
+ const base::Callback<update_client::UpdateClient*(void)>& factory);
+
// Associates an incognito context with |main_context_|.
void SetIncognitoContext(content::BrowserContext* incognito_context);
@@ -96,6 +106,8 @@ class TestExtensionsBrowserClient : public ExtensionsBrowserClient {
bool IsMinBrowserVersionSupported(const std::string& min_version) override;
ExtensionWebContentsObserver* GetExtensionWebContentsObserver(
content::WebContents* web_contents) override;
+ scoped_refptr<update_client::UpdateClient> CreateUpdateClient(
+ content::BrowserContext* context) override;
private:
content::BrowserContext* main_context_; // Not owned.
@@ -109,6 +121,8 @@ class TestExtensionsBrowserClient : public ExtensionsBrowserClient {
scoped_ptr<ExtensionCache> extension_cache_;
+ base::Callback<update_client::UpdateClient*(void)> update_client_factory_;
+
DISALLOW_COPY_AND_ASSIGN(TestExtensionsBrowserClient);
};

Powered by Google App Engine
This is Rietveld 408576698