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

Side by Side 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, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/environment.h" 5 #include "base/environment.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/sys_info.h" 7 #include "base/sys_info.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, 106 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version,
107 &os_minor_version, 107 &os_minor_version,
108 &os_bugfix_version); 108 &os_bugfix_version);
109 EXPECT_EQ(0, os_major_version); 109 EXPECT_EQ(0, os_major_version);
110 EXPECT_EQ(0, os_minor_version); 110 EXPECT_EQ(0, os_minor_version);
111 EXPECT_EQ(0, os_bugfix_version); 111 EXPECT_EQ(0, os_bugfix_version);
112 } 112 }
113 113
114 TEST_F(SysInfoTest, GoogleChromeOSLsbReleaseTime) { 114 TEST_F(SysInfoTest, GoogleChromeOSLsbReleaseTime) {
115 const char* kLsbRelease = "CHROMEOS_RELEASE_VERSION=1.2.3.4"; 115 const char* kLsbRelease = "CHROMEOS_RELEASE_VERSION=1.2.3.4";
116 base::Time lsb_release_time = base::Time::Now(); 116 // Use a fake time that can be safely displayed as a string.
117 const base::Time lsb_release_time(base::Time::FromDoubleT(12345.6));
117 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, lsb_release_time); 118 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, lsb_release_time);
118 base::Time parsed_lsb_release_time = base::SysInfo::GetLsbReleaseTime(); 119 base::Time parsed_lsb_release_time = base::SysInfo::GetLsbReleaseTime();
119 EXPECT_EQ(lsb_release_time.ToDoubleT(), 120 EXPECT_DOUBLE_EQ(lsb_release_time.ToDoubleT(),
120 parsed_lsb_release_time.ToDoubleT()); 121 parsed_lsb_release_time.ToDoubleT());
121 } 122 }
122 123
123 #endif // OS_CHROMEOS 124 #endif // OS_CHROMEOS
OLDNEW
« 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