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

Unified Diff: base/sys_info_unittest.cc

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge fix Created 7 years, 3 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 | « base/sys_info_chromeos.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_unittest.cc
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc
index 6dc325fa58936d0879c194bd426ca4e53d3757d4..eacf76c55c65c10b94d663c60b88b4653a422004 100644
--- a/base/sys_info_unittest.cc
+++ b/base/sys_info_unittest.cc
@@ -121,4 +121,26 @@ TEST_F(SysInfoTest, GoogleChromeOSLsbReleaseTime) {
parsed_lsb_release_time.ToDoubleT());
}
+TEST_F(SysInfoTest, IsRunningOnChromeOS) {
+ base::SysInfo::SetChromeOSVersionInfoForTest("", base::Time());
+ EXPECT_FALSE(base::SysInfo::IsRunningOnChromeOS());
+
+ const char* kLsbRelease1 =
+ "CHROMEOS_RELEASE_NAME=Non Chrome OS\n"
+ "CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease1, base::Time());
+ EXPECT_FALSE(base::SysInfo::IsRunningOnChromeOS());
+
+ const char* kLsbRelease2 =
+ "CHROMEOS_RELEASE_NAME=Chrome OS\n"
+ "CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time());
+ EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
+
+ const char* kLsbRelease3 =
+ "CHROMEOS_RELEASE_NAME=Chromium OS\n";
+ base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time());
+ EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS());
+}
+
#endif // OS_CHROMEOS
« no previous file with comments | « base/sys_info_chromeos.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698