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

Unified Diff: components/update_client/test_configurator.cc

Issue 2873533002: Prepare to abstract PersistedData by making it part of the configurator.
Patch Set: Fix ios compile error. 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..ced5066189bd761b00795084b6162293b8ed62c2 100644
--- a/components/update_client/test_configurator.cc
+++ b/components/update_client/test_configurator.cc
@@ -9,6 +9,7 @@
#include "base/version.h"
#include "components/prefs/pref_service.h"
#include "components/update_client/out_of_process_patcher.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,6 +163,10 @@ 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());
@@ -168,11 +174,15 @@ TestConfigurator::GetSequencedTaskRunner() const {
}
PrefService* TestConfigurator::GetPrefService() const {
- return nullptr;
+ return pref_;
}
bool TestConfigurator::IsPerUserInstall() const {
return true;
}
+std::unique_ptr<PersistedData> TestConfigurator::CreateMetadata() const {
+ return base::MakeUnique<PersistedData>(GetPrefService());
+}
+
} // namespace update_client

Powered by Google App Engine
This is Rietveld 408576698