Index: components/update_client/test_configurator.cc |
diff --git a/components/update_client/test_configurator.cc b/components/update_client/test_configurator.cc |
index 322044ac9dbe10e3c33167151b616b9f856cb0c6..2b06fb51f6d8e65b31bc58f4a55f05e92a256e52 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/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,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; |
} |
+PersistedData* TestConfigurator::CreateMetadata() const { |
+ return new PersistedData(GetPrefService()); |
+} |
+ |
} // namespace update_client |