| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/memory_pressure_monitor.h" | 5 #include "components/memory_pressure/memory_pressure_monitor.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/task_runner.h" |
| 10 #include "base/test/simple_test_tick_clock.h" | 11 #include "base/test/simple_test_tick_clock.h" |
| 11 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
| 12 #include "components/memory_pressure/memory_pressure_stats_collector.h" | 13 #include "components/memory_pressure/memory_pressure_stats_collector.h" |
| 13 #include "components/memory_pressure/test_memory_pressure_calculator.h" | 14 #include "components/memory_pressure/test_memory_pressure_calculator.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 namespace memory_pressure { | 18 namespace memory_pressure { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 ExpectDispatchCritical(); | 381 ExpectDispatchCritical(); |
| 381 monitor_->OnMemoryPressureChanged(MEMORY_PRESSURE_LEVEL_CRITICAL); | 382 monitor_->OnMemoryPressureChanged(MEMORY_PRESSURE_LEVEL_CRITICAL); |
| 382 VerifyAndClearExpectations(); | 383 VerifyAndClearExpectations(); |
| 383 ExpectCritical(); | 384 ExpectCritical(); |
| 384 EXPECT_EQ(2u, monitor_->scheduled_checks().size()); | 385 EXPECT_EQ(2u, monitor_->scheduled_checks().size()); |
| 385 } | 386 } |
| 386 | 387 |
| 387 #endif // !MEMORY_PRESSURE_IS_POLLING | 388 #endif // !MEMORY_PRESSURE_IS_POLLING |
| 388 | 389 |
| 389 } // namespace memory_pressure | 390 } // namespace memory_pressure |
| OLD | NEW |