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

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

Issue 397543005: Encapsulate data-format constants in EnterpriseInstallAttributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Julian's nit. Created 6 years, 5 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 | « no previous file | chrome/browser/chromeos/policy/enterprise_install_attributes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 782cf3d7fe9812e0085a5ad4d9b9050188f382dd..b2a56d2e778364b16eff0696023725362ac1eb5f 100644
--- a/chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc
+++ b/chrome/browser/chromeos/policy/device_policy_cros_browser_test.cc
@@ -13,7 +13,6 @@
#include "base/stl_util.h"
#include "chrome/browser/chromeos/policy/device_policy_builder.h"
#include "chrome/browser/chromeos/policy/enterprise_install_attributes.h"
-#include "chrome/browser/chromeos/policy/proto/install_attributes.pb.h"
#include "chrome/common/chrome_paths.h"
#include "chromeos/chromeos_paths.h"
#include "chromeos/dbus/fake_dbus_thread_manager.h"
@@ -35,22 +34,14 @@ DevicePolicyCrosTestHelper::~DevicePolicyCrosTestHelper() {}
void DevicePolicyCrosTestHelper::MarkAsEnterpriseOwned() {
OverridePaths();
- cryptohome::SerializedInstallAttributes install_attrs_proto;
- cryptohome::SerializedInstallAttributes::Attribute* attribute = NULL;
-
- attribute = install_attrs_proto.add_attributes();
- attribute->set_name(EnterpriseInstallAttributes::kAttrEnterpriseOwned);
- attribute->set_value("true");
-
- attribute = install_attrs_proto.add_attributes();
- attribute->set_name(EnterpriseInstallAttributes::kAttrEnterpriseUser);
- attribute->set_value(device_policy_.policy_data().username());
+ const std::string install_attrs_blob(
+ EnterpriseInstallAttributes::
+ GetEnterpriseOwnedInstallAttributesBlobForTesting(
+ device_policy_.policy_data().username()));
base::FilePath install_attrs_file;
ASSERT_TRUE(
PathService::Get(chromeos::FILE_INSTALL_ATTRIBUTES, &install_attrs_file));
- const std::string install_attrs_blob(
- install_attrs_proto.SerializeAsString());
ASSERT_EQ(static_cast<int>(install_attrs_blob.size()),
base::WriteFile(install_attrs_file,
install_attrs_blob.c_str(),
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/enterprise_install_attributes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698