Elim cr-checkbox
[chromium-blink-merge.git] / chrome / browser / chromeos / policy / stub_enterprise_install_attributes.h
blob84b4473c517f533b7753c6e42f966abac7f5d030
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
12 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
14 namespace policy {
16 // This class allows tests to override specific values for easier testing.
17 // To make IsEnterpriseDevice() return true, set a non-empty registration
18 // user.
19 class StubEnterpriseInstallAttributes : public EnterpriseInstallAttributes {
20 public:
21 StubEnterpriseInstallAttributes();
23 void SetDomain(const std::string& domain);
24 void SetRegistrationUser(const std::string& user);
25 void SetDeviceId(const std::string& id);
26 void SetMode(DeviceMode mode);
28 private:
29 DISALLOW_COPY_AND_ASSIGN(StubEnterpriseInstallAttributes);
32 // Helper class to set enterprise install attributes in the scope of a test.
33 class ScopedStubEnterpriseInstallAttributes {
34 public:
35 ScopedStubEnterpriseInstallAttributes(const std::string& domain,
36 const std::string& registration_user,
37 const std::string& device_id,
38 DeviceMode mode);
39 ~ScopedStubEnterpriseInstallAttributes();
42 } // namespace policy
44 #endif // CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_