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

Unified Diff: chromeos/chromeos_paths.cc

Issue 2774673004: Add stub implementations for state keys and VPD (Closed)
Patch Set: Rebase Created 3 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 | « chromeos/chromeos_paths.h ('k') | chromeos/dbus/session_manager_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/chromeos_paths.cc
diff --git a/chromeos/chromeos_paths.cc b/chromeos/chromeos_paths.cc
index bdb3fa9c1f5997be3f72c058967e0c9e28b46379..53177d2eef8f70abae1152a8734d486d87f18a90 100644
--- a/chromeos/chromeos_paths.cc
+++ b/chromeos/chromeos_paths.cc
@@ -32,6 +32,9 @@ const base::FilePath::CharType kInstallAttributesFileName[] =
const base::FilePath::CharType kMachineHardwareInfoFileName[] =
FILE_PATH_LITERAL("/tmp/machine-info");
+const base::FilePath::CharType kVpdFileName[] =
+ FILE_PATH_LITERAL("/var/log/vpd_2.0.txt");
+
const base::FilePath::CharType kUptimeFileName[] =
FILE_PATH_LITERAL("/proc/uptime");
@@ -73,6 +76,9 @@ bool PathProvider(int key, base::FilePath* result) {
case FILE_MACHINE_INFO:
*result = base::FilePath(kMachineHardwareInfoFileName);
break;
+ case FILE_VPD:
+ *result = base::FilePath(kVpdFileName);
+ break;
case FILE_UPTIME:
*result = base::FilePath(kUptimeFileName);
break;
@@ -111,8 +117,8 @@ void RegisterPathProvider() {
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.
+ // 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,
@@ -134,6 +140,11 @@ void RegisterStubPathOverrides(const base::FilePath& stubs_dir) {
parent.AppendASCII("stub_machine-info"),
is_absolute,
create);
+ PathService::OverrideAndCreateIfNeeded(
+ FILE_VPD,
+ parent.AppendASCII("stub_vpd"),
+ is_absolute,
+ create);
PathService::Override(
DIR_DEVICE_LOCAL_ACCOUNT_EXTENSIONS,
parent.AppendASCII("stub_device_local_account_extensions"));
« no previous file with comments | « chromeos/chromeos_paths.h ('k') | chromeos/dbus/session_manager_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698