OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "chrome/browser/chromeos/settings/device_settings_provider.h" | |
12 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" | |
13 | |
14 class Profile; | |
15 | |
16 namespace chromeos { | |
17 | |
18 class FakeOwnerSettingsService; | |
19 class ScopedTestCrosSettings; | |
20 class ScopedTestDeviceSettingsService; | |
21 | |
22 class SettingsProviderTestBase { | |
23 public: | |
24 SettingsProviderTestBase(); | |
Mattias Nissler (ping if slow)
2015/03/30 14:45:46
nit: blank line before comment.
| |
25 // In some cases it is required to pass |create_settings_service| as false: | |
26 // if the test already has a device settings service and/or CrosSettings set | |
27 // up by another bundle, creating another one causes crash. | |
28 explicit SettingsProviderTestBase(bool create_settings_service); | |
29 virtual ~SettingsProviderTestBase(); | |
30 | |
31 protected: | |
32 // Methods to replace and restore CrosSettingsProvider for the specified path. | |
33 void ReplaceProvider(const std::string& path); | |
34 void RestoreProvider(); | |
35 | |
36 void InitOwnerSettingsService(Profile* profile); | |
37 | |
38 // Helpers used to mock out cros settings. | |
39 scoped_ptr<ScopedTestDeviceSettingsService> test_device_settings_service_; | |
40 scoped_ptr<ScopedTestCrosSettings> test_cros_settings_; | |
41 CrosSettingsProvider* device_settings_provider_ = nullptr; | |
42 StubCrosSettingsProvider stub_settings_provider_; | |
43 | |
44 scoped_ptr<chromeos::FakeOwnerSettingsService> owner_settings_service_; | |
45 | |
46 private: | |
47 DISALLOW_COPY_AND_ASSIGN(SettingsProviderTestBase); | |
Mattias Nissler (ping if slow)
2015/03/30 14:45:46
#include "base/macros.h"
| |
48 }; | |
49 | |
50 } // namespace chromeos | |
51 | |
52 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_ | |
OLD | NEW |