Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: components/memory_pressure/test_memory_pressure_calculator.h

Issue 2874553004: Remove memory_pressure component. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/memory_pressure/test_memory_pressure_calculator.h
diff --git a/components/memory_pressure/test_memory_pressure_calculator.h b/components/memory_pressure/test_memory_pressure_calculator.h
deleted file mode 100644
index 4eae886d493c21aaa86b02abeda7ce6be3850a2f..0000000000000000000000000000000000000000
--- a/components/memory_pressure/test_memory_pressure_calculator.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_MEMORY_PRESSURE_TEST_MEMORY_PRESSURE_CALCULATOR_H_
-#define COMPONENTS_MEMORY_PRESSURE_TEST_MEMORY_PRESSURE_CALCULATOR_H_
-
-#include "base/macros.h"
-#include "components/memory_pressure/memory_pressure_calculator.h"
-
-namespace memory_pressure {
-
-#if defined(MEMORY_PRESSURE_IS_POLLING)
-
-// A mock memory pressure calculator for unittesting.
-class TestMemoryPressureCalculator : public MemoryPressureCalculator {
- public:
- // Defaults to no pressure.
- TestMemoryPressureCalculator();
- explicit TestMemoryPressureCalculator(MemoryPressureLevel level);
- ~TestMemoryPressureCalculator() override {}
-
- // MemoryPressureCalculator implementation.
- MemoryPressureLevel CalculateCurrentPressureLevel() override;
-
- // Sets the mock calculator to return the given pressure level.
- void SetLevel(MemoryPressureLevel level);
-
- // Sets the mock calculator to return no pressure.
- void SetNone();
-
- // Sets the mock calculator to return moderate pressure.
- void SetModerate();
-
- // Sets the mock calculator to return critical pressure.
- void SetCritical();
-
- // Resets the call counter to 'CalculateCurrentPressureLevel'.
- void ResetCalls();
-
- // Returns the number of calls to 'CalculateCurrentPressureLevel'.
- int calls() const { return calls_; }
-
- private:
- MemoryPressureLevel level_;
- int calls_;
-
- DISALLOW_COPY_AND_ASSIGN(TestMemoryPressureCalculator);
-};
-
-#endif // defined(MEMORY_PRESSURE_IS_POLLING)
-
-} // namespace memory_pressure
-
-#endif // COMPONENTS_MEMORY_PRESSURE_TEST_MEMORY_PRESSURE_CALCULATOR_H_

Powered by Google App Engine
This is Rietveld 408576698