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

Unified Diff: chrome/browser/chromeos/settings/stub_install_attributes.h

Issue 2403053003: Remove unused email from install attributes and add support for AD. (Closed)
Patch Set: Address Maksim's comments. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/stub_install_attributes.h
diff --git a/chrome/browser/chromeos/settings/stub_install_attributes.h b/chrome/browser/chromeos/settings/stub_install_attributes.h
index 86a943a7eb38d2d67dc8ca24cdac34dfdbf3af4f..2358c2c35e090eb2759e80c0d2ed7b6e58fcf7df 100644
--- a/chrome/browser/chromeos/settings/stub_install_attributes.h
+++ b/chrome/browser/chromeos/settings/stub_install_attributes.h
@@ -13,17 +13,19 @@
namespace chromeos {
-// This class allows tests to override specific values for easier testing.
-// To make IsEnterpriseDevice() return true, set a non-empty registration
-// user.
+// This class allows tests to set specific configurations for testing.
class StubInstallAttributes : public InstallAttributes {
public:
StubInstallAttributes();
- void SetDomain(const std::string& domain);
- void SetRegistrationUser(const std::string& user);
- void SetDeviceId(const std::string& id);
- void SetMode(policy::DeviceMode mode);
+ // Setup as not-yet enrolled.
+ void Clear();
+
+ // Setup as consumer device. (Clears existing configuration.)
+ void SetConsumer();
+
+ // Setup as enterprise enrolled. (Clears existing configuration.)
+ void SetEnterprise(const std::string& domain, const std::string& device_id);
private:
DISALLOW_COPY_AND_ASSIGN(StubInstallAttributes);
@@ -32,11 +34,21 @@ class StubInstallAttributes : public InstallAttributes {
// Helper class to set install attributes in the scope of a test.
class ScopedStubInstallAttributes {
public:
- ScopedStubInstallAttributes(const std::string& domain,
- const std::string& registration_user,
- const std::string& device_id,
- policy::DeviceMode mode);
~ScopedStubInstallAttributes();
+
+ // Factory for empty (unset) ScopedStubInstallAttributes.
+ static ScopedStubInstallAttributes CreateUnset();
+
+ // Factory for consumer-type ScopedStubInstallAttributes.
+ static ScopedStubInstallAttributes CreateConsumer();
+
+ // Factory for enterprise-type ScopedStubInstallAttributes.
+ static ScopedStubInstallAttributes CreateEnterprise(
+ const std::string& domain,
+ const std::string& device_id);
+
+ private:
+ ScopedStubInstallAttributes();
};
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698