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

Unified Diff: components/update_client/test_configurator.cc

Issue 2873533002: Prepare to abstract PersistedData by making it part of the configurator.
Patch Set: Replace MakeShared with MakeRefCounted. Created 3 years, 7 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: components/update_client/test_configurator.cc
diff --git a/components/update_client/test_configurator.cc b/components/update_client/test_configurator.cc
index b2bf95ddccb1ed233d802af4be81e215b5da866d..7bfce6e28e1a3bc2ee494082e0c1a4c1994ac4f1 100644
--- a/components/update_client/test_configurator.cc
+++ b/components/update_client/test_configurator.cc
@@ -8,7 +8,8 @@
#include "base/single_thread_task_runner.h"
#include "base/version.h"
#include "components/prefs/pref_service.h"
-#include "components/update_client/out_of_process_patcher.h"
+#include "components/update_client/component_patcher_operation.h"
+#include "components/update_client/persisted_data.h"
#include "net/url_request/url_request_test_util.h"
#include "url/gurl.h"
@@ -34,6 +35,7 @@ TestConfigurator::TestConfigurator(
ondemand_time_(0),
enabled_cup_signing_(false),
enabled_component_updates_(true),
+ pref_(nullptr),
context_(new net::TestURLRequestContextGetter(network_task_runner)) {}
TestConfigurator::~TestConfigurator() {
@@ -161,18 +163,22 @@ void TestConfigurator::SetPingUrl(const GURL& url) {
ping_url_ = url;
}
+void TestConfigurator::SetPrefService(PrefService* pref) {
+ pref_ = pref;
+}
+
scoped_refptr<base::SequencedTaskRunner>
TestConfigurator::GetSequencedTaskRunner() const {
DCHECK(worker_task_runner_.get());
return worker_task_runner_;
}
-PrefService* TestConfigurator::GetPrefService() const {
- return nullptr;
-}
-
bool TestConfigurator::IsPerUserInstall() const {
return true;
}
+std::unique_ptr<PersistedData> TestConfigurator::CreateMetadata() const {
+ return base::MakeUnique<PersistedData>(pref_);
+}
+
} // namespace update_client

Powered by Google App Engine
This is Rietveld 408576698