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

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

Issue 1019283004: Switch to direct use of OwnerSettingsServiceChromeOS::Set() in tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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/device_policy_cros_browser_test.cc
diff --git a/chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc b/chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc
index 59e840165995fc26e73017450334e125208820aa..8e780717fee5ab43bfd9a34fb1bb505fa80e35a2 100644
--- a/chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc
+++ b/chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
-#include <string>
#include <vector>
#include "base/files/file_path.h"
@@ -31,13 +30,14 @@ DevicePolicyCrosTestHelper::DevicePolicyCrosTestHelper() {}
DevicePolicyCrosTestHelper::~DevicePolicyCrosTestHelper() {}
-void DevicePolicyCrosTestHelper::MarkAsEnterpriseOwned() {
+// static
+void DevicePolicyCrosTestHelper::MarkAsEnterpriseOwnedBy(
+ const std::string& user_name) {
OverridePaths();
const std::string install_attrs_blob(
EnterpriseInstallAttributes::
- GetEnterpriseOwnedInstallAttributesBlobForTesting(
- device_policy_.policy_data().username()));
+ GetEnterpriseOwnedInstallAttributesBlobForTesting(user_name));
base::FilePath install_attrs_file;
ASSERT_TRUE(
@@ -48,6 +48,10 @@ void DevicePolicyCrosTestHelper::MarkAsEnterpriseOwned() {
install_attrs_blob.size()));
}
+void DevicePolicyCrosTestHelper::MarkAsEnterpriseOwned() {
+ MarkAsEnterpriseOwnedBy(device_policy_.policy_data().username());
+}
+
void DevicePolicyCrosTestHelper::InstallOwnerKey() {
OverridePaths();
@@ -63,6 +67,7 @@ void DevicePolicyCrosTestHelper::InstallOwnerKey() {
static_cast<int>(owner_key_bits.size()));
}
+// static
void DevicePolicyCrosTestHelper::OverridePaths() {
// This is usually done by ChromeBrowserMainChromeOS, but some tests
// use the overridden paths before ChromeBrowserMain starts. Make sure that

Powered by Google App Engine
This is Rietveld 408576698