This change prepares for later CLs that partly replaces
logic in the module that depends on the Module system
for logic that depends on task queues.
The change also changes SendTransport::SendRTCP
to schedule packet reception with the simulated time
controller. This fixes the problem that SendRTCP itself
updates the simulated time which makes it hard to
understand the tests.
Finally, GlobalSimulatedTimeController was updated
to support addition of custom SimulatedSequenceRunners
like SendTransport.
Bug: webrtc:11581
Change-Id: I0aa310ad0a10526479ad8c28affc38a413363ffd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/222602
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34348}
This is a reland of b70c5c5ce9
Original change's description:
> Using simulated rtc::Thread for peer connection scenario tests.
>
> Bug: webrtc:11255
> Change-Id: I5d29e997a7209ffc64595082358cca9b2115d07a
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165689
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#30258}
Bug: webrtc:11255
Change-Id: If65cd56b59158cebec5609407a721fbdb47cfd1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166046
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30294}
The overlap in functionality is quite limited and separating the
functionality makes it a bit easier to follow each. This prepares
for adding a SimulatedThread class in a follow up CL.
Bug: webrtc:11255
Change-Id: I83c754bd570113dfb582098bb4d39e27bb4f4d87
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165688
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30229}
This change means tasks scheduled at the end time reached when making a call to GlobalSimulatedTimeController::AdvanceTime will also be executed.
In other words, with this change, if you schedule a task in X milliseconds and then call AdvanceTime(TimeDelta::ms(X)) the scheduled task will be executed.
Bug: none
Change-Id: I337e574a88b235639e82ffcacf1484daa6cf3172
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/164522
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30146}
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}
This change renames TimeController's Sleep method to AdvanceTime, unifying
the same name with the same semantic as for downstream projects.
Bug: webrtc:11154
Change-Id: Id79bcf0eafcd0b47a76407ba220479d84df5a736
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161092
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29989}
Creates an abstraction for an "alarm clock" which can schedule
time-controller callbacks and exposes a time controller driven by
an external alarm.
Bug: webrtc:9719
Change-Id: I08c2aa9dba25603043bfba48f55c925716a55bae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/158969
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Bjorn Mellem <mellem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29879}
This is used to avoid thread processing in simulated time
controller. This saves up to 30% execution time in debug builds.
Bug: webrtc:10365
Change-Id: Ie83dfb2468d371e4687d28c776acf7e23eb411d1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133173
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27666}
Without this |ready_runners_| might still have entries left if the
yield call comes from another task queue (only done in testing).
Bug: webrtc:10365
Change-Id: I704249e00bf5e75e1f58fdda1809b955de20c304
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132713
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27596}
We need to keep the lock until we have finished using the task runner
returned by GetNextReadyRunner to ensure that we don't remove it from
another thread. Additionally, we must get only one runner at a time in
case the first runner removes the second runner.
Bug: webrtc:10538
Change-Id: Idbd5610b67666238545b3a321fb79f7e86fcac56
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132342
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27584}
Replacing sets of pointers (that will depend on allocation addresses)
with vectors and lists. This allows deterministic execution.
Also doing some cleanup of the task queue configuration, ensuring that
the task queue states is not set outside of actual task queues.
Bug: webrtc:10365
Change-Id: I1fad621c7b1ba0bbb33db8c3bd69cb3a1e212b9c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130460
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27364}
This CL introduces the TimeControllerInterface that provides timing
related functionality. Most notably it provides a TaskQueueFactory
and facilitates creation of ProcessThread.
Two implementations of the interface are provided, RealTimeController
and SimulatedTimeController.
This prepares for an upcoming CL using these in Scenario tests.
Bug: webrtc:10365
Change-Id: Id956a29628d7e2f53ecaedadd643a9f697329d2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127297
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27244}