| 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" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
| 15 | 15 |
| 16 typedef PlatformTest SysInfoTest; | 16 typedef PlatformTest SysInfoTest; |
| 17 using base::FilePath; | 17 using base::FilePath; |
| 18 | 18 |
| 19 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | |
| 20 TEST_F(SysInfoTest, MaxSharedMemorySize) { | |
| 21 // We aren't actually testing that it's correct, just that it's sane. | |
| 22 EXPECT_GT(base::SysInfo::MaxSharedMemorySize(), 0u); | |
| 23 } | |
| 24 #endif | |
| 25 | |
| 26 TEST_F(SysInfoTest, NumProcs) { | 19 TEST_F(SysInfoTest, NumProcs) { |
| 27 // We aren't actually testing that it's correct, just that it's sane. | 20 // We aren't actually testing that it's correct, just that it's sane. |
| 28 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); | 21 EXPECT_GE(base::SysInfo::NumberOfProcessors(), 1); |
| 29 } | 22 } |
| 30 | 23 |
| 31 TEST_F(SysInfoTest, AmountOfMem) { | 24 TEST_F(SysInfoTest, AmountOfMem) { |
| 32 // We aren't actually testing that it's correct, just that it's sane. | 25 // We aren't actually testing that it's correct, just that it's sane. |
| 33 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); | 26 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemory(), 0); |
| 34 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); | 27 EXPECT_GT(base::SysInfo::AmountOfPhysicalMemoryMB(), 0); |
| 35 // The maxmimal amount of virtual memory can be zero which means unlimited. | 28 // The maxmimal amount of virtual memory can be zero which means unlimited. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); | 142 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease2, base::Time()); |
| 150 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); | 143 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); |
| 151 | 144 |
| 152 const char kLsbRelease3[] = | 145 const char kLsbRelease3[] = |
| 153 "CHROMEOS_RELEASE_NAME=Chromium OS\n"; | 146 "CHROMEOS_RELEASE_NAME=Chromium OS\n"; |
| 154 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time()); | 147 base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease3, base::Time()); |
| 155 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); | 148 EXPECT_TRUE(base::SysInfo::IsRunningOnChromeOS()); |
| 156 } | 149 } |
| 157 | 150 |
| 158 #endif // OS_CHROMEOS | 151 #endif // OS_CHROMEOS |
| OLD | NEW |