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

Unified Diff: chromeos/chromeos_paths.cc

Issue 258743005: Enable Enterprise enrollment on desktop builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added arg to PathService::OverrideAndCreateIfNeeded, added test for FakeCryptohomeClient::InstallAt… 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: chromeos/chromeos_paths.cc
diff --git a/chromeos/chromeos_paths.cc b/chromeos/chromeos_paths.cc
index 25174d45ddd1a3f534aa46bafad46209ed7767e6..a9963affe335654e38df140c71d496dfbebd4af2 100644
--- a/chromeos/chromeos_paths.cc
+++ b/chromeos/chromeos_paths.cc
@@ -4,8 +4,10 @@
#include "chromeos/chromeos_paths.h"
+#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
+#include "base/sys_info.h"
namespace chromeos {
@@ -77,4 +79,26 @@ void RegisterPathProvider() {
PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
}
+void RegisterStubPathOverrides(const base::FilePath& stubs_dir) {
+ CHECK(!base::SysInfo::IsRunningOnChromeOS());
+ // Override these paths on the desktop, so that enrollment and cloud
+ // policy work and can be tested.
+ base::FilePath parent = base::MakeAbsoluteFilePath(stubs_dir);
+ PathService::Override(
+ DIR_USER_POLICY_KEYS,
+ parent.AppendASCII("stub_user_policy"));
+ const bool is_absolute = true;
+ const bool create = false;
+ PathService::OverrideAndCreateIfNeeded(
+ FILE_OWNER_KEY,
+ parent.AppendASCII("stub_owner.key"),
+ is_absolute,
+ create);
+ PathService::OverrideAndCreateIfNeeded(
+ FILE_INSTALL_ATTRIBUTES,
+ parent.AppendASCII("stub_install_attributes.pb"),
+ is_absolute,
+ create);
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698