OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/memory_pressure/filtered_memory_pressure_calculator.h" | 5 #include "components/memory_pressure/filtered_memory_pressure_calculator.h" |
6 | 6 |
| 7 #include "base/macros.h" |
7 #include "base/test/simple_test_tick_clock.h" | 8 #include "base/test/simple_test_tick_clock.h" |
8 #include "components/memory_pressure/test_memory_pressure_calculator.h" | 9 #include "components/memory_pressure/test_memory_pressure_calculator.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 | 11 |
11 namespace memory_pressure { | 12 namespace memory_pressure { |
12 | 13 |
13 #if defined(MEMORY_PRESSURE_IS_POLLING) | 14 #if defined(MEMORY_PRESSURE_IS_POLLING) |
14 | 15 |
15 class FilteredMemoryPressureCalculatorTest : public testing::Test { | 16 class FilteredMemoryPressureCalculatorTest : public testing::Test { |
16 public: | 17 public: |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 calculator_.SetCritical(); | 275 calculator_.SetCritical(); |
275 EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL, | 276 EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL, |
276 filter_.CalculateCurrentPressureLevel()); | 277 filter_.CalculateCurrentPressureLevel()); |
277 EXPECT_EQ(3, calculator_.calls()); | 278 EXPECT_EQ(3, calculator_.calls()); |
278 EXPECT_FALSE(filter_.cooldown_in_progress()); | 279 EXPECT_FALSE(filter_.cooldown_in_progress()); |
279 } | 280 } |
280 | 281 |
281 #endif // defined(MEMORY_PRESSURE_IS_POLLING) | 282 #endif // defined(MEMORY_PRESSURE_IS_POLLING) |
282 | 283 |
283 } // namespace memory_pressure | 284 } // namespace memory_pressure |
OLD | NEW |