Index: chrome/browser/chromeos/device_settings_provider.h |
diff --git a/chrome/browser/chromeos/device_settings_provider.h b/chrome/browser/chromeos/device_settings_provider.h |
index 4794b5380f082e3b0b24003da6cd21827991e9d2..5d827950d5d90d2a310e14d549c6695b3bb7ac3d 100644 |
--- a/chrome/browser/chromeos/device_settings_provider.h |
+++ b/chrome/browser/chromeos/device_settings_provider.h |
@@ -40,7 +40,21 @@ class DeviceSettingsProvider : public CrosSettingsProvider, |
virtual bool HandlesSetting(const std::string& path) const OVERRIDE; |
virtual void Reload() OVERRIDE; |
+ protected: |
+ // Constructor used by tests to mock the low level dependencies of this class. |
+ DeviceSettingsProvider(const NotifyObserversCallback& notify_cb, |
+ SignedSettingsHelper* signed_settings_helper, |
+ OwnershipService::Status ownership_service); |
Mattias Nissler (ping if slow)
2012/03/16 15:21:11
it seems like the name |ownership_service| is slig
pastarmovj
2012/03/21 15:23:27
Done.
|
+ |
+ // For test use only. |
+ void set_ownership_status(OwnershipService::Status status) { |
+ ownership_status_ = status; |
+ } |
+ |
private: |
+ // Does the real intialization, shared by both constructors. |
+ void Initialize(); |
+ |
// CrosSettingsProvider implementation: |
virtual void DoSet(const std::string& path, |
const base::Value& value) OVERRIDE; |
@@ -126,6 +140,7 @@ class DeviceSettingsProvider : public CrosSettingsProvider, |
// Pending callbacks that need to be invoked after settings verification. |
std::vector<base::Closure> callbacks_; |
+ SignedSettingsHelper* signed_settings_helper_; |
OwnershipService::Status ownership_status_; |
mutable scoped_ptr<SignedSettingsMigrationHelper> migration_helper_; |
@@ -144,6 +159,9 @@ class DeviceSettingsProvider : public CrosSettingsProvider, |
typedef std::pair<std::string, base::Value*> PendingQueueElement; |
std::vector<PendingQueueElement> pending_changes_; |
+ friend class DeviceSettingsProviderTest; |
+ FRIEND_TEST_ALL_PREFIXES(DeviceSettingsProviderTest, |
+ InitializationTestUnowned); |
DISALLOW_COPY_AND_ASSIGN(DeviceSettingsProvider); |
}; |