commit | ccefc5ac63e8a2f4dc26e5864747258adc727b35 | [log] [tgz] |
---|---|---|
author | Shintaro Kawamura <[email protected]> | Mon May 08 16:46:18 2023 |
committer | Chromium LUCI CQ <[email protected]> | Mon May 08 16:46:18 2023 |
tree | ab70963f916796c7bfba1716c62a0763ed025a7f | |
parent | 726dbaa1685d9c84b95b94654220b1b42e0e4bba [diff] [blame] |
base: timer: fix MockOneShotTimer::FireNow failure MockOneShotTimer::FireNow() calls always fail due to DCHECK on task_runner_. Override the method to bypass the DCHECK. Bypassing is safe because MockOneShotTimer does not allow SetTaskRunner(). BUG=none TEST=mock_timer_unittest.cc Change-Id: I2938a2b2aaea2d27791edffcf7046779615c9f7d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4494915 Reviewed-by: Gabriel Charette <[email protected]> Commit-Queue: Gabriel Charette <[email protected]> Auto-Submit: Shin Kawamura <[email protected]> Cr-Commit-Position: refs/heads/main@{#1140903}
diff --git a/base/timer/timer.h b/base/timer/timer.h index afe8302a..b34be71 100644 --- a/base/timer/timer.h +++ b/base/timer/timer.h
@@ -250,7 +250,7 @@ // Run the scheduled task immediately, and stop the timer. The timer needs to // be running. - void FireNow(); + virtual void FireNow(); private: void OnStop() final;