Commit 1a32b862 authored by chrisha's avatar chrisha Committed by Commit bot

Make FilteredMemoryPressureCalculator injected dependencies externally owned.

This makes final integration with the MemoryPressureMonitor easier, as it will own a single TickClock which can be injected down the entire stack of dependencies.

BUG=520962

Review URL: https://codereview.chromium.org/1317353006

Cr-Commit-Position: refs/heads/master@{#347850}
parent d6eca98d
......@@ -4,7 +4,7 @@
#include "components/memory_pressure/filtered_memory_pressure_calculator.h"
#include "base/time/default_tick_clock.h"
#include "base/time/tick_clock.h"
namespace memory_pressure {
......@@ -24,13 +24,17 @@ const int FilteredMemoryPressureCalculator::kModeratePressureCooldownPeriodMs =
5000;
FilteredMemoryPressureCalculator::FilteredMemoryPressureCalculator(
scoped_ptr<MemoryPressureCalculator> pressure_calculator)
: tick_clock_(new base::DefaultTickClock()),
pressure_calculator_(pressure_calculator.Pass()),
MemoryPressureCalculator* pressure_calculator,
base::TickClock* tick_clock)
: pressure_calculator_(pressure_calculator),
tick_clock_(tick_clock),
current_pressure_level_(
MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE),
samples_taken_(false),
cooldown_in_progress_(false) {}
cooldown_in_progress_(false) {
DCHECK(pressure_calculator);
DCHECK(tick_clock);
}
FilteredMemoryPressureCalculator::~FilteredMemoryPressureCalculator() {
}
......
......@@ -5,9 +5,14 @@
#ifndef COMPONENTS_MEMORY_PRESSURE_FILTERED_MEMORY_PRESSURE_CALCULATOR_H_
#define COMPONENTS_MEMORY_PRESSURE_FILTERED_MEMORY_PRESSURE_CALCULATOR_H_
#include "base/time/tick_clock.h"
#include "components/memory_pressure/memory_pressure_calculator.h"
#include "base/time/time.h"
namespace base {
class TickClock;
} // namespace base
namespace memory_pressure {
#if defined(MEMORY_PRESSURE_IS_POLLING)
......@@ -26,18 +31,16 @@ class FilteredMemoryPressureCalculator : public MemoryPressureCalculator {
static const int kCriticalPressureCooldownPeriodMs;
static const int kModeratePressureCooldownPeriodMs;
explicit FilteredMemoryPressureCalculator(
scoped_ptr<MemoryPressureCalculator> pressure_calculator);
// The provided |pressure_calculator| and |tick_clock| must outlive this
// object.
FilteredMemoryPressureCalculator(
MemoryPressureCalculator* pressure_calculator,
base::TickClock* tick_clock);
~FilteredMemoryPressureCalculator() override;
// Calculates the current pressure level.
MemoryPressureLevel CalculateCurrentPressureLevel() override;
// Testing seam for configuring the tick clock in use.
void set_tick_clock(scoped_ptr<base::TickClock> tick_clock) {
tick_clock_ = tick_clock.Pass();
}
// Accessors for unittesting.
bool cooldown_in_progress() const { return cooldown_in_progress_; }
base::TimeTicks cooldown_start_time() const { return cooldown_start_time_; }
......@@ -46,11 +49,11 @@ class FilteredMemoryPressureCalculator : public MemoryPressureCalculator {
private:
friend class TestFilteredMemoryPressureCalculator;
// The delegate tick clock. This is settable as a testing seam.
scoped_ptr<base::TickClock> tick_clock_;
// The delegate pressure calculator. Provided by the constructor.
scoped_ptr<MemoryPressureCalculator> pressure_calculator_;
MemoryPressureCalculator* pressure_calculator_;
// The delegate tick clock. Provided by the constructor.
base::TickClock* tick_clock_;
// The memory pressure currently being reported.
MemoryPressureLevel current_pressure_level_;
......
......@@ -15,282 +15,267 @@ namespace memory_pressure {
class FilteredMemoryPressureCalculatorTest : public testing::Test {
public:
FilteredMemoryPressureCalculatorTest()
: calculator_(nullptr), tick_clock_(nullptr) {}
void SetUp() override {
// Ownership of the calculator and tick clock are both passed to the filter.
calculator_ = new TestMemoryPressureCalculator();
tick_clock_ = new base::SimpleTestTickClock();
filter_.reset(new FilteredMemoryPressureCalculator(
scoped_ptr<MemoryPressureCalculator>(calculator_)));
filter_->set_tick_clock(scoped_ptr<base::TickClock>(tick_clock_));
}
void TearDown() override {
calculator_ = nullptr;
tick_clock_ = nullptr;
filter_.reset();
}
: filter_(&calculator_, &tick_clock_) {}
// Advances the tick clock by the given number of milliseconds.
void Tick(int ms) {
tick_clock_->Advance(base::TimeDelta::FromMilliseconds(ms));
tick_clock_.Advance(base::TimeDelta::FromMilliseconds(ms));
}
// Delegates that are inject into the filter under test.
TestMemoryPressureCalculator* calculator_;
base::SimpleTestTickClock* tick_clock_;
// Delegates that are injected into the object under test.
TestMemoryPressureCalculator calculator_;
base::SimpleTestTickClock tick_clock_;
// The object under test.
scoped_ptr<FilteredMemoryPressureCalculator> filter_;
FilteredMemoryPressureCalculator filter_;
private:
DISALLOW_COPY_AND_ASSIGN(FilteredMemoryPressureCalculatorTest);
};
TEST_F(FilteredMemoryPressureCalculatorTest, FirstCallInvokesCalculator) {
calculator_->SetCritical();
calculator_.SetCritical();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest, CalculatorNotAlwaysInvoked) {
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Change the pressure reported by the caculator, but don't expect the filter
// to report the critical value until a minimum sampling period has passed.
// The level has to be increasing so that hysteresis doesn't come into play.
calculator_->SetCritical();
calculator_.SetCritical();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs / 2);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// A sufficient time has passed so now it should report the new level.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest, CooldownCriticalToModerate) {
calculator_->SetCritical();
calculator_.SetCritical();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Initiate a cooldown period by jumping sufficiently far ahead for another
// sample.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
EXPECT_EQ(tick_clock_->NowTicks(), filter_->cooldown_start_time());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(tick_clock_.NowTicks(), filter_.cooldown_start_time());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step another sample interval and it should still not have changed.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step the cooldown period and it should change state.
Tick(FilteredMemoryPressureCalculator::kCriticalPressureCooldownPeriodMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest,
CooldownCriticalToModerateViaNone) {
calculator_->SetCritical();
calculator_.SetCritical();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Initiate a cooldown period by jumping sufficiently far ahead for another
// sample. First go directly to no memory pressure before passing back through
// moderate. The final result should be a moderate memory pressure.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetNone();
calculator_.SetNone();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
EXPECT_EQ(tick_clock_->NowTicks(), filter_->cooldown_start_time());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(tick_clock_.NowTicks(), filter_.cooldown_start_time());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step another sample interval and it should still not have changed.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step the cooldown period and it should change state.
Tick(FilteredMemoryPressureCalculator::kCriticalPressureCooldownPeriodMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest, CooldownCriticalToNone) {
calculator_->SetCritical();
calculator_.SetCritical();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Initiate a cooldown period by jumping sufficiently far ahead for another
// sample.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetNone();
calculator_.SetNone();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
EXPECT_EQ(tick_clock_->NowTicks(), filter_->cooldown_start_time());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(tick_clock_.NowTicks(), filter_.cooldown_start_time());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step another sample interval and it should still not have changed.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step the cooldown period and it should change state.
Tick(FilteredMemoryPressureCalculator::kCriticalPressureCooldownPeriodMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest, CooldownModerateToNone) {
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Initiate a cooldown period by jumping sufficiently far ahead for another
// sample.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetNone();
calculator_.SetNone();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
EXPECT_EQ(tick_clock_->NowTicks(), filter_->cooldown_start_time());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(tick_clock_.NowTicks(), filter_.cooldown_start_time());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step another sample interval and it should still not have changed.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step the cooldown period and it should change state.
Tick(FilteredMemoryPressureCalculator::kModeratePressureCooldownPeriodMs);
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(4, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest, InterruptedCooldownModerate) {
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Initiate a cooldown period by jumping sufficiently far ahead for another
// sample.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetNone();
calculator_.SetNone();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
EXPECT_EQ(tick_clock_->NowTicks(), filter_->cooldown_start_time());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(tick_clock_.NowTicks(), filter_.cooldown_start_time());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step another sample interval and it should still not have changed. Since
// the pressure level has increased back to moderate it should also end the
// cooldown period.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
TEST_F(FilteredMemoryPressureCalculatorTest, InterruptedCooldownCritical) {
calculator_->SetModerate();
calculator_.SetModerate();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(1, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
// Initiate a cooldown period by jumping sufficiently far ahead for another
// sample.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetNone();
calculator_.SetNone();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_->calls());
EXPECT_TRUE(filter_->cooldown_in_progress());
EXPECT_EQ(tick_clock_->NowTicks(), filter_->cooldown_start_time());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(2, calculator_.calls());
EXPECT_TRUE(filter_.cooldown_in_progress());
EXPECT_EQ(tick_clock_.NowTicks(), filter_.cooldown_start_time());
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
filter_->cooldown_high_tide());
filter_.cooldown_high_tide());
// Step another sample interval and it should still not have changed. Since
// the pressure level has increased to critical it ends the cooldown period
// and immediately reports the critical memory pressure.
Tick(FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs);
calculator_->SetCritical();
calculator_.SetCritical();
EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
filter_->CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_->calls());
EXPECT_FALSE(filter_->cooldown_in_progress());
filter_.CalculateCurrentPressureLevel());
EXPECT_EQ(3, calculator_.calls());
EXPECT_FALSE(filter_.cooldown_in_progress());
}
#endif // defined(MEMORY_PRESSURE_IS_POLLING)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment