Chromium Code Reviews| Index: base/process_util_unittest.cc |
| diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc |
| index fe392e2da36c92d78b3d59d455e1262617945dec..0986f1f22c86d90e5f1305a9cbbde058968efef9 100644 |
| --- a/base/process_util_unittest.cc |
| +++ b/base/process_util_unittest.cc |
| @@ -380,6 +380,40 @@ TEST_F(ProcessUtilTest, SetProcessBackgroundedSelf) { |
| EXPECT_EQ(old_priority, new_priority); |
| } |
| +#if defined(OS_LINUX) || defined(OS_ANDROID) |
| +TEST_F(ProcessUtilTest, GetSystemMemoryInfo) { |
| + base::SystemMemoryInfoKB info1; |
|
jar (doing other things)
2013/02/14 02:26:11
nit: how about using the name |info|.
I assume yo
|
| + EXPECT_TRUE(base::GetSystemMemoryInfo(&info1)); |
| + |
| + // Ensure each field received a value. |
| + EXPECT_GT(info1.total, 0); |
| + EXPECT_GT(info1.free, 0); |
| + EXPECT_GT(info1.buffers, 0); |
| + EXPECT_GT(info1.cached, 0); |
| + EXPECT_GT(info1.active_anon, 0); |
| + EXPECT_GT(info1.inactive_anon, 0); |
| + EXPECT_GT(info1.active_file, 0); |
| + EXPECT_GT(info1.inactive_file, 0); |
| + |
| + // All the values should be less than the total amount of memory. |
| + EXPECT_LT(info1.free, info1.total); |
| + EXPECT_LT(info1.buffers, info1.total); |
| + EXPECT_LT(info1.cached, info1.total); |
| + EXPECT_LT(info1.active_anon, info1.total); |
| + EXPECT_LT(info1.inactive_anon, info1.total); |
| + EXPECT_LT(info1.active_file, info1.total); |
| + EXPECT_LT(info1.inactive_file, info1.total); |
| + |
| +#if defined(OS_CHROMEOS) |
| + // Chrome OS exposes shmem. |
| + EXPECT_GT(info1.shmem, 0); |
| + EXPECT_LT(info1.shmem, info1.total); |
| + // Chrome unit tests are not run on actual Chrome OS hardware, so gem_objects |
| + // and gem_size cannot be tested here. |
| +#endif |
| +} |
| +#endif // defined(OS_LINUX) || defined(OS_ANDROID) |
| + |
| // TODO(estade): if possible, port these 2 tests. |
| #if defined(OS_WIN) |
| TEST_F(ProcessUtilTest, EnableLFH) { |