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
3 // found in the LICENSE file.
5 #include "components/memory_pressure/test_memory_pressure_calculator.h"
7 namespace memory_pressure
{
9 #if defined(MEMORY_PRESSURE_IS_POLLING)
11 TestMemoryPressureCalculator::TestMemoryPressureCalculator()
12 : level_(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE
), calls_(0) {}
14 TestMemoryPressureCalculator::MemoryPressureLevel
15 TestMemoryPressureCalculator::CalculateCurrentPressureLevel() {
20 void TestMemoryPressureCalculator::SetNone() {
21 level_
= MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE
;
24 void TestMemoryPressureCalculator::SetModerate() {
25 level_
= MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE
;
28 void TestMemoryPressureCalculator::SetCritical() {
29 level_
= MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL
;
32 void TestMemoryPressureCalculator::ResetCalls() {
36 #endif // defined(MEMORY_PRESSURE_IS_POLLING)
38 } // namespace memory_pressure