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

Unified Diff: chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc

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
« no previous file with comments | « chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
diff --git a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
index 5d67f7c0b61e465fb803f77153f6c246334fa3e5..7f56557712ab04ee7299cd5379c602303f4050a9 100644
--- a/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
+++ b/chrome/browser/chromeos/policy/stub_enterprise_install_attributes.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
namespace policy {
@@ -32,4 +33,23 @@ void StubEnterpriseInstallAttributes::SetMode(DeviceMode mode) {
registration_mode_ = mode;
}
+ScopedStubEnterpriseInstallAttributes::ScopedStubEnterpriseInstallAttributes(
+ const std::string& domain,
+ const std::string& registration_user,
+ const std::string& device_id,
+ DeviceMode mode) {
+ StubEnterpriseInstallAttributes* attributes =
+ new StubEnterpriseInstallAttributes();
+ attributes->SetDomain(domain);
+ attributes->SetRegistrationUser(registration_user);
+ attributes->SetDeviceId(device_id);
+ attributes->SetMode(mode);
+ BrowserPolicyConnectorChromeOS::SetInstallAttributesForTesting(attributes);
+}
+
+ScopedStubEnterpriseInstallAttributes::
+~ScopedStubEnterpriseInstallAttributes() {
+ BrowserPolicyConnectorChromeOS::RemoveInstallAttributesForTesting();
+}
+
} // namespace policy
« no previous file with comments | « chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698