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

Unified Diff: components/memory_pressure/memory_pressure_monitor_unittest.cc

Issue 2122543002: Replace Closure in TaskRunner::PostTask with OneShotCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@07_oneshot
Patch Set: fix Created 4 years, 3 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
« no previous file with comments | « chromeos/tpm/tpm_token_info_getter_unittest.cc ('k') | components/timers/alarm_timer_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/memory_pressure/memory_pressure_monitor_unittest.cc
diff --git a/components/memory_pressure/memory_pressure_monitor_unittest.cc b/components/memory_pressure/memory_pressure_monitor_unittest.cc
index 429bdd08786c58e1d4622fc21747bc34f2a1698e..878b5997f9cedc703bbc75673b9f8447be18077f 100644
--- a/components/memory_pressure/memory_pressure_monitor_unittest.cc
+++ b/components/memory_pressure/memory_pressure_monitor_unittest.cc
@@ -34,10 +34,7 @@ using testing::_;
// counting confuses gmock.
class LenientMockTaskRunner {
public:
- MOCK_METHOD3(PostDelayedTask,
- bool(const tracked_objects::Location&,
- const base::Closure&,
- base::TimeDelta));
+ MOCK_METHOD1(PostDelayedTask, bool(base::TimeDelta));
};
using MockTaskRunner = testing::StrictMock<LenientMockTaskRunner>;
@@ -48,9 +45,9 @@ class TaskRunnerProxy : public base::TaskRunner {
explicit TaskRunnerProxy(MockTaskRunner* mock) : mock_(mock) {}
bool RunsTasksOnCurrentThread() const override { return true; }
bool PostDelayedTask(const tracked_objects::Location& location,
- const base::Closure& closure,
+ base::OnceClosure closure,
base::TimeDelta delta) override {
- return mock_->PostDelayedTask(location, closure, delta);
+ return mock_->PostDelayedTask(delta);
}
private:
@@ -168,7 +165,7 @@ class MemoryPressureMonitorTest : public testing::Test {
// Sets expectations for tasks scheduled via |mock_task_runner_|.
void ExpectTaskPosted(int delay_ms) {
base::TimeDelta delay = base::TimeDelta::FromMilliseconds(delay_ms);
- EXPECT_CALL(mock_task_runner_, PostDelayedTask(_, _, delay))
+ EXPECT_CALL(mock_task_runner_, PostDelayedTask(delay))
.WillOnce(testing::Return(true));
}
« no previous file with comments | « chromeos/tpm/tpm_token_info_getter_unittest.cc ('k') | components/timers/alarm_timer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698