OLD | NEW |
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/sys_info.h" | 9 #include "base/sys_info.h" |
10 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 } | 38 } |
39 | 39 |
40 TEST_F(SysInfoTest, AmountOfTotalDiskSpace) { | 40 TEST_F(SysInfoTest, AmountOfTotalDiskSpace) { |
41 // We aren't actually testing that it's correct, just that it's sane. | 41 // We aren't actually testing that it's correct, just that it's sane. |
42 FilePath tmp_path; | 42 FilePath tmp_path; |
43 ASSERT_TRUE(base::GetTempDir(&tmp_path)); | 43 ASSERT_TRUE(base::GetTempDir(&tmp_path)); |
44 EXPECT_GT(base::SysInfo::AmountOfTotalDiskSpace(tmp_path), 0) | 44 EXPECT_GT(base::SysInfo::AmountOfTotalDiskSpace(tmp_path), 0) |
45 << tmp_path.value(); | 45 << tmp_path.value(); |
46 } | 46 } |
47 | 47 |
48 #if defined(OS_WIN) || defined(OS_MACOSX) | 48 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
49 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { | 49 TEST_F(SysInfoTest, OperatingSystemVersionNumbers) { |
50 int32_t os_major_version = -1; | 50 int32_t os_major_version = -1; |
51 int32_t os_minor_version = -1; | 51 int32_t os_minor_version = -1; |
52 int32_t os_bugfix_version = -1; | 52 int32_t os_bugfix_version = -1; |
53 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, | 53 base::SysInfo::OperatingSystemVersionNumbers(&os_major_version, |
54 &os_minor_version, | 54 &os_minor_version, |
55 &os_bugfix_version); | 55 &os_bugfix_version); |
56 EXPECT_GT(os_major_version, -1); | 56 EXPECT_GT(os_major_version, -1); |
57 EXPECT_GT(os_minor_version, -1); | 57 EXPECT_GT(os_minor_version, -1); |
58 EXPECT_GT(os_bugfix_version, -1); | 58 EXPECT_GT(os_bugfix_version, -1); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 const char* kLsbRelease1 = "CHROMEOS_RELEASE_BOARD=Glimmer\n"; | 160 const char* kLsbRelease1 = "CHROMEOS_RELEASE_BOARD=Glimmer\n"; |
161 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease1, base::Time()); | 161 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease1, base::Time()); |
162 EXPECT_EQ("glimmer", base::SysInfo::GetStrippedReleaseBoard()); | 162 EXPECT_EQ("glimmer", base::SysInfo::GetStrippedReleaseBoard()); |
163 | 163 |
164 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys"; | 164 const char* kLsbRelease2 = "CHROMEOS_RELEASE_BOARD=glimmer-signed-mp-v4keys"; |
165 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); | 165 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); |
166 EXPECT_EQ("glimmer", base::SysInfo::GetStrippedReleaseBoard()); | 166 EXPECT_EQ("glimmer", base::SysInfo::GetStrippedReleaseBoard()); |
167 } | 167 } |
168 | 168 |
169 #endif // OS_CHROMEOS | 169 #endif // OS_CHROMEOS |
OLD | NEW |