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

Side by Side Diff: chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h

Issue 247283007: Add ScopedStubEnterpriseInstallAttributes for tests to set test install attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 11 matching lines...) Expand all
22 22
23 void SetDomain(const std::string& domain); 23 void SetDomain(const std::string& domain);
24 void SetRegistrationUser(const std::string& user); 24 void SetRegistrationUser(const std::string& user);
25 void SetDeviceId(const std::string& id); 25 void SetDeviceId(const std::string& id);
26 void SetMode(DeviceMode mode); 26 void SetMode(DeviceMode mode);
27 27
28 private: 28 private:
29 DISALLOW_COPY_AND_ASSIGN(StubEnterpriseInstallAttributes); 29 DISALLOW_COPY_AND_ASSIGN(StubEnterpriseInstallAttributes);
30 }; 30 };
31 31
32 // Helper class to set enterprise install attributes in the scope of a test.
33 // Note: The install attributes cannot be removed once set, so the instance sets
34 // the attributes on construction, but does not remove them on destruction.
35 class ScopedStubEnterpriseInstallAttributes {
36 public:
37 ScopedStubEnterpriseInstallAttributes(const std::string& domain,
38 const std::string& registration_user,
39 const std::string& device_id,
40 DeviceMode mode);
41 };
42
32 } // namespace policy 43 } // namespace policy
33 44
34 #endif // CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_ 45 #endif // CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698