Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/browser/memory/memory_monitor_android.h" | |
| 6 | |
| 7 #include "testing/gtest/include/gtest/gtest.h" | |
| 8 | |
| 9 namespace content { | |
| 10 | |
| 11 class MemoryMonitorAndroidTest : public testing::Test { | |
| 12 public: | |
| 13 MemoryMonitorAndroidTest() : monitor_(MemoryMonitorAndroid::Create()) {} | |
| 14 | |
| 15 protected: | |
| 16 std::unique_ptr<MemoryMonitorAndroid> monitor_; | |
| 17 }; | |
| 18 | |
| 19 TEST_F(MemoryMonitorAndroidTest, CanGetMemoryInfo) { | |
| 20 EXPECT_TRUE(monitor_->CanGetMemoryInfo()); | |
| 21 } | |
| 22 | |
| 23 TEST_F(MemoryMonitorAndroidTest, GetMemoryInfo) { | |
| 24 MemoryMonitorAndroid::MemoryInfo info; | |
| 25 monitor_->GetMemoryInfo(&info); | |
| 26 EXPECT_GT(info.avail_mem, 0); | |
| 27 EXPECT_GT(info.threshold, 0); | |
| 28 EXPECT_GT(info.total_mem, 0); | |
| 29 } | |
|
chrisha
2016/09/26 17:56:48
A test of the actual GetFreeMemoryUntilCriticalMb
bashi
2016/09/26 23:30:19
In this test, GetFreeMemoryUntilCriticalMb() retur
chrisha
2016/09/27 15:47:16
I'd prefer we use a mock and test the actual logic
bashi
2016/09/29 01:24:21
Working on this.
https://codereview.chromium.org/2
| |
| 30 | |
| 31 } // namespace content | |
| OLD | NEW |