Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/chromeos/settings/settings_provider_test_base.h

Issue 1019283004: Switch to direct use of OwnerSettingsServiceChromeOS::Set() in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/macros.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
bartfab (slow) 2015/03/31 14:12:41 Nit: Not used.
13 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
14
15 class Profile;
16
17 namespace chromeos {
18
19 class FakeOwnerSettingsService;
20 class ScopedTestCrosSettings;
21 class ScopedTestDeviceSettingsService;
22
23 class SettingsProviderTestBase {
bartfab (slow) 2015/03/31 14:12:41 You are using a strange paradigm here. Even though
24 public:
25 SettingsProviderTestBase();
26
27 // In some cases it is required to pass |create_settings_service| as false:
28 // if the test already has a device settings service and/or CrosSettings set
29 // up by another bundle, creating another one causes crash.
30 explicit SettingsProviderTestBase(bool create_settings_service);
31 virtual ~SettingsProviderTestBase();
32
33 protected:
34 // Methods to replace and restore CrosSettingsProvider for the specified path.
35 void ReplaceProvider(const std::string& path);
36 void RestoreProvider();
37
38 void InitOwnerSettingsService(Profile* profile);
39
40 // Helpers used to mock out cros settings.
41 scoped_ptr<ScopedTestDeviceSettingsService> test_device_settings_service_;
42 scoped_ptr<ScopedTestCrosSettings> test_cros_settings_;
43 CrosSettingsProvider* device_settings_provider_ = nullptr;
bartfab (slow) 2015/03/31 14:12:41 Nit: Forward-declare CrosSettingProvider.
44 StubCrosSettingsProvider stub_settings_provider_;
45
46 scoped_ptr<chromeos::FakeOwnerSettingsService> owner_settings_service_;
bartfab (slow) 2015/03/31 14:12:41 Nit: s/chromeos:://
47
48 private:
49 DISALLOW_COPY_AND_ASSIGN(SettingsProviderTestBase);
50 };
51
52 } // namespace chromeos
53
54 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_SETTINGS_PROVIDER_TEST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698