summaryrefslogtreecommitdiff
path: root/chromium/base/system/sys_info_chromeos.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/base/system/sys_info_chromeos.cc')
-rw-r--r--chromium/base/system/sys_info_chromeos.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chromium/base/system/sys_info_chromeos.cc b/chromium/base/system/sys_info_chromeos.cc
index 1d688f13491..6be670fb0d3 100644
--- a/chromium/base/system/sys_info_chromeos.cc
+++ b/chromium/base/system/sys_info_chromeos.cc
@@ -223,4 +223,21 @@ void SysInfo::SetChromeOSVersionInfoForTest(const std::string& lsb_release,
g_chrome_os_version_info.Get().Parse();
}
+// static
+void SysInfo::CrashIfChromeOSNonTestImage() {
+ if (!IsRunningOnChromeOS())
+ return;
+
+ // On the test images etc/lsb-release has a line:
+ // CHROMEOS_RELEASE_TRACK=testimage-channel.
+ const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK";
+ const char kTestImageRelease[] = "testimage-channel";
+
+ std::string track;
+ CHECK(SysInfo::GetLsbReleaseValue(kChromeOSReleaseTrack, &track));
+
+ // Crash if can't find test-image marker in the release track.
+ CHECK_NE(track.find(kTestImageRelease), std::string::npos);
+}
+
} // namespace base