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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
diff --git a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
index 2ddccecfc17be367d3366eaabfca857e9d519f26..88f7bbebe102d5b5040724aaed73bd9690118d79 100644
--- a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
+++ b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h
@@ -29,6 +29,17 @@ class StubEnterpriseInstallAttributes : public EnterpriseInstallAttributes {
DISALLOW_COPY_AND_ASSIGN(StubEnterpriseInstallAttributes);
};
+// Helper class to set enterprise install attributes in the scope of a test.
+// Note: The install attributes cannot be removed once set, so the instance sets
+// the attributes on construction, but does not remove them on destruction.
+class ScopedStubEnterpriseInstallAttributes {
+ public:
+ ScopedStubEnterpriseInstallAttributes(const std::string& domain,
+ const std::string& registration_user,
+ const std::string& device_id,
+ DeviceMode mode);
+};
+
} // namespace policy
#endif // CHROME_BROWSER_CHROMEOS_POLICY_STUB_ENTERPRISE_INSTALL_ATTRIBUTES_H_

Powered by Google App Engine
This is Rietveld 408576698