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

Side by Side Diff: base/sys_info_unittest.cc

Issue 2764593002: Getting OS version numbers for Linux. (Closed)
Patch Set: Fixing build Created 3 years, 9 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
« no previous file with comments | « base/sys_info_posix.cc ('k') | 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/process/process_metrics.h" 9 #include "base/process/process_metrics.h"
10 #include "base/sys_info.h" 10 #include "base/sys_info.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 EXPECT_GE(SysInfo::AmountOfFreeDiskSpace(tmp_path), 0) << tmp_path.value(); 64 EXPECT_GE(SysInfo::AmountOfFreeDiskSpace(tmp_path), 0) << tmp_path.value();
65 } 65 }
66 66
67 TEST_F(SysInfoTest, AmountOfTotalDiskSpace) { 67 TEST_F(SysInfoTest, AmountOfTotalDiskSpace) {
68 // We aren't actually testing that it's correct, just that it's sane. 68 // We aren't actually testing that it's correct, just that it's sane.
69 FilePath tmp_path; 69 FilePath tmp_path;
70 ASSERT_TRUE(GetTempDir(&tmp_path)); 70 ASSERT_TRUE(GetTempDir(&tmp_path));
71 EXPECT_GT(SysInfo::AmountOfTotalDiskSpace(tmp_path), 0) << tmp_path.value(); 71 EXPECT_GT(SysInfo::AmountOfTotalDiskSpace(tmp_path), 0) << tmp_path.value();
72 } 72 }
73 73
74 #if defined(OS_WIN) || defined(OS_MACOSX) 74 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
75 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { 75 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) {
76 int32_t os_major_version = -1; 76 int32_t os_major_version = -1;
77 int32_t os_minor_version = -1; 77 int32_t os_minor_version = -1;
78 int32_t os_bugfix_version = -1; 78 int32_t os_bugfix_version = -1;
79 SysInfo::OperatingSystemVersionNumbers(&os_major_version, 79 SysInfo::OperatingSystemVersionNumbers(&os_major_version,
80 &os_minor_version, 80 &os_minor_version,
81 &os_bugfix_version); 81 &os_bugfix_version);
82 EXPECT_GT(os_major_version, -1); 82 EXPECT_GT(os_major_version, -1);
83 EXPECT_GT(os_minor_version, -1); 83 EXPECT_GT(os_minor_version, -1);
84 EXPECT_GT(os_bugfix_version, -1); 84 EXPECT_GT(os_bugfix_version, -1);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard()); 188 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard());
189 189
190 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys"; 190 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys";
191 SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, Time()); 191 SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, Time());
192 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard()); 192 EXPECT_EQ("glimmer", SysInfo::GetStrippedReleaseBoard());
193 } 193 }
194 194
195 #endif // OS_CHROMEOS 195 #endif // OS_CHROMEOS
196 196
197 } // namespace base 197 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698