Index: chrome/browser/chromeos/settings/settings_provider_test_base.h |
diff --git a/chrome/browser/chromeos/settings/settings_provider_test_base.h b/chrome/browser/chromeos/settings/settings_provider_test_base.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..973ec6edbc9249b1e52c140aa317fe9385cf3d43 |
--- /dev/null |
+++ b/chrome/browser/chromeos/settings/settings_provider_test_base.h |
@@ -0,0 +1,52 @@ |
+// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_ |
+#define CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_ |
+ |
+#include <string> |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/chromeos/settings/device_settings_provider.h" |
+#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" |
+ |
+class Profile; |
+ |
+namespace chromeos { |
+ |
+class FakeOwnerSettingsService; |
+class ScopedTestCrosSettings; |
+class ScopedTestDeviceSettingsService; |
+ |
+class SettingsProviderTestBase { |
+ public: |
+ SettingsProviderTestBase(); |
Mattias Nissler (ping if slow)
2015/03/30 14:45:46
nit: blank line before comment.
|
+ // In some cases it is required to pass |create_settings_service| as false: |
+ // if the test already has a device settings service and/or CrosSettings set |
+ // up by another bundle, creating another one causes crash. |
+ explicit SettingsProviderTestBase(bool create_settings_service); |
+ virtual ~SettingsProviderTestBase(); |
+ |
+ protected: |
+ // Methods to replace and restore CrosSettingsProvider for the specified path. |
+ void ReplaceProvider(const std::string& path); |
+ void RestoreProvider(); |
+ |
+ void InitOwnerSettingsService(Profile* profile); |
+ |
+ // Helpers used to mock out cros settings. |
+ scoped_ptr<ScopedTestDeviceSettingsService> test_device_settings_service_; |
+ scoped_ptr<ScopedTestCrosSettings> test_cros_settings_; |
+ CrosSettingsProvider* device_settings_provider_ = nullptr; |
+ StubCrosSettingsProvider stub_settings_provider_; |
+ |
+ scoped_ptr<chromeos::FakeOwnerSettingsService> owner_settings_service_; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(SettingsProviderTestBase); |
Mattias Nissler (ping if slow)
2015/03/30 14:45:46
#include "base/macros.h"
|
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_ |