Commit 55e58cf6 authored by Alex Chau's avatar Alex Chau Committed by Commit Bot

Allow setting DeviceInfoTracker for testing in SharingSyncPreference

Bug: 1037793
Change-Id: Iee42f82af527875c936310764f323942c8f97023
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062983Reviewed-by: default avatarRichard Knoll <knollr@chromium.org>
Commit-Queue: Alex Chau <alexchau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742683}
parent 8e7b370a
......@@ -411,6 +411,12 @@ void SharingSyncPreference::ClearLocalSharingInfo() {
}
}
void SharingSyncPreference::SetDeviceInfoTrackerForTesting(
syncer::DeviceInfoTracker* tracker) {
DCHECK(tracker);
device_info_tracker_ = tracker;
}
// static
base::Optional<syncer::DeviceInfo::SharingInfo>
SharingSyncPreference::GetLocalSharingInfo(PrefService* prefs) {
......
......@@ -112,6 +112,9 @@ class SharingSyncPreference {
void ClearLocalSharingInfo();
// Replaces DeviceInfoTracker for testing.
void SetDeviceInfoTrackerForTesting(syncer::DeviceInfoTracker* tracker);
private:
friend class SharingSyncPreferenceTest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment