Always enter yield policy scope using simulated TimeControllers.
This makes the class easier to use at a minor cost of making it slightly
more magic.
Bug: webrtc:9883
Change-Id: If807cfbf046615333c3bcd3b58a001813102a9f9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161231
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Markus Handell <handellm@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30008}
diff --git a/test/time_controller/external_time_controller.h b/test/time_controller/external_time_controller.h
index 3ae302e..869a78f 100644
--- a/test/time_controller/external_time_controller.h
+++ b/test/time_controller/external_time_controller.h
@@ -38,8 +38,6 @@
std::unique_ptr<ProcessThread> CreateProcessThread(
const char* thread_name) override;
void AdvanceTime(TimeDelta duration) override;
- void InvokeWithControlledYield(std::function<void()> closure) override;
- rtc::YieldInterface* YieldInterface() override;
// Implementation of TaskQueueFactory.
std::unique_ptr<TaskQueueBase, TaskQueueDeleter> CreateTaskQueue(
@@ -59,6 +57,7 @@
ControlledAlarmClock* alarm_;
sim_time_impl::SimulatedTimeControllerImpl impl_;
+ rtc::ScopedYieldPolicy yield_policy_;
// Overrides the global rtc::Clock to ensure that it reports the same times as
// the time controller.