OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/sys_utils.h" | |
6 | |
7 #include <unistd.h> | 5 #include <unistd.h> |
8 | 6 |
| 7 #include "base/sys_info.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
10 | 9 |
11 namespace base { | 10 namespace base { |
12 namespace android { | 11 namespace android { |
13 | 12 |
14 TEST(SysUtils, AmountOfPhysicalMemory) { | 13 TEST(SysUtils, AmountOfPhysicalMemory) { |
15 // Check that the RAM size reported by sysconf() matches the one | 14 // Check that the RAM size reported by sysconf() matches the one |
16 // computed by base::android::SysUtils::AmountOfPhysicalMemory(). | 15 // computed by base::SysInfo::AmountOfPhysicalMemory(). |
17 size_t sys_ram_size = | 16 size_t sys_ram_size = |
18 static_cast<size_t>(sysconf(_SC_PHYS_PAGES) * PAGE_SIZE); | 17 static_cast<size_t>(sysconf(_SC_PHYS_PAGES) * PAGE_SIZE); |
19 EXPECT_EQ(sys_ram_size, SysUtils::AmountOfPhysicalMemoryKB() * 1024UL); | 18 EXPECT_EQ(sys_ram_size, SysInfo::AmountOfPhysicalMemory()); |
20 } | 19 } |
21 | 20 |
22 } // namespace android | 21 } // namespace android |
23 } // namespace base | 22 } // namespace base |
OLD | NEW |