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

Unified Diff: base/sys_info_unittest.cc

Issue 24878002: Fix unit test for 23588009 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « no previous file | no next file » | 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 d123357dea77e40e0e5e13d4fdb103969b28dbfd..6dc325fa58936d0879c194bd426ca4e53d3757d4 100644
--- a/base/sys_info_unittest.cc
+++ b/base/sys_info_unittest.cc
@@ -113,11 +113,12 @@ TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) {
TEST_F(SysInfoTest, GoogleChromeOSLsbReleaseTime) {
const char* kLsbRelease = "CHROMEOS_RELEASE_VERSION=1.2.3.4";
- base::Time lsb_release_time = base::Time::Now();
+ // Use a fake time that can be safely displayed as a string.
+ const base::Time lsb_release_time(base::Time::FromDoubleT(12345.6));
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, lsb_release_time);
base::Time parsed_lsb_release_time = base::SysInfo::GetLsbReleaseTime();
- EXPECT_EQ(lsb_release_time.ToDoubleT(),
- parsed_lsb_release_time.ToDoubleT());
+ EXPECT_DOUBLE_EQ(lsb_release_time.ToDoubleT(),
+ parsed_lsb_release_time.ToDoubleT());
}
#endif // OS_CHROMEOS
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698