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

Side by Side Diff: chrome/browser/chromeos/ownership/fake_owner_settings_service.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: Rebase 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ 6 #define CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" 10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h"
11 11
12 class Profile; 12 class Profile;
13 13
14 namespace ownership { 14 namespace ownership {
15 class OwnerKeyUtil; 15 class OwnerKeyUtil;
16 } 16 }
17 17
18 namespace chromeos { 18 namespace chromeos {
19 19
20 class StubCrosSettingsProvider;
21
20 class FakeOwnerSettingsService : public OwnerSettingsServiceChromeOS { 22 class FakeOwnerSettingsService : public OwnerSettingsServiceChromeOS {
21 public: 23 public:
24 explicit FakeOwnerSettingsService(Profile* profile);
22 FakeOwnerSettingsService( 25 FakeOwnerSettingsService(
23 Profile* profile, 26 Profile* profile,
24 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util); 27 const scoped_refptr<ownership::OwnerKeyUtil>& owner_key_util,
28 StubCrosSettingsProvider* provider);
25 ~FakeOwnerSettingsService() override; 29 ~FakeOwnerSettingsService() override;
26 30
27 void set_set_management_settings_result(bool success) { 31 void set_set_management_settings_result(bool success) {
28 set_management_settings_result_ = success; 32 set_management_settings_result_ = success;
29 } 33 }
30 34
31 const ManagementSettings& last_settings() const { 35 const ManagementSettings& last_settings() const {
32 return last_settings_; 36 return last_settings_;
33 } 37 }
34 38
35 // OwnerSettingsServiceChromeOS: 39 // OwnerSettingsServiceChromeOS:
36 void SetManagementSettings( 40 void SetManagementSettings(
37 const ManagementSettings& settings, 41 const ManagementSettings& settings,
38 const OnManagementSettingsSetCallback& callback) override; 42 const OnManagementSettingsSetCallback& callback) override;
43 bool Set(const std::string& setting, const base::Value& value) override;
39 44
40 private: 45 private:
41 bool set_management_settings_result_; 46 bool set_management_settings_result_;
42 ManagementSettings last_settings_; 47 ManagementSettings last_settings_;
48 StubCrosSettingsProvider* settings_provider_;
43 49
44 DISALLOW_COPY_AND_ASSIGN(FakeOwnerSettingsService); 50 DISALLOW_COPY_AND_ASSIGN(FakeOwnerSettingsService);
45 }; 51 };
46 52
47 } // namespace chromeos 53 } // namespace chromeos
48 54
49 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_ 55 #endif // CHROME_BROWSER_CHROMEOS_OWNERSHIP_FAKE_OWNER_SETTINGS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698