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}
This commit is contained in:
Sebastian Jansson
2020-01-14 11:13:20 +01:00
committed by Commit Bot
parent 71574f7f3b
commit b70c5c5ce9
20 changed files with 395 additions and 33 deletions

View File

@ -265,6 +265,10 @@ specific_include_rules = {
"+rtc_base/thread_checker.h",
],
"time_controller\.h": [
"+rtc_base/thread.h",
],
"videocodec_test_fixture\.h": [
"+modules/video_coding/include/video_codec_interface.h"
],

View File

@ -12,12 +12,14 @@
#include <functional>
#include <memory>
#include <string>
#include "api/task_queue/task_queue_factory.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "modules/utility/include/process_thread.h"
#include "rtc_base/synchronization/yield_policy.h"
#include "rtc_base/thread.h"
#include "system_wrappers/include/clock.h"
namespace webrtc {
@ -37,6 +39,11 @@ class TimeController {
// Creates a process thread.
virtual std::unique_ptr<ProcessThread> CreateProcessThread(
const char* thread_name) = 0;
// Creates an rtc::Thread instance. If |socket_server| is nullptr, a default
// noop socket server is created.
virtual std::unique_ptr<rtc::Thread> CreateThread(
const std::string& name,
std::unique_ptr<rtc::SocketServer> socket_server = nullptr) = 0;
// Allow task queues and process threads created by this instance to execute
// for the given |duration|.
virtual void AdvanceTime(TimeDelta duration) = 0;