Revert "Using simulated rtc::Thread for peer connection scenario tests."

This reverts commit b70c5c5ce97e7dcf2e1d8453f5ea0639d4b60453.

Reason for revert: Interferes with other tests in same binary.

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}

TBR=steveanton@webrtc.org,srte@webrtc.org

Change-Id: If2e60edae264a4bb0dee3abf66ba2078fd85f493
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:11255
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166045
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30259}
This commit is contained in:
Sebastian Jansson
2020-01-15 10:09:54 +00:00
committed by Commit Bot
parent b70c5c5ce9
commit f1173f46e5
20 changed files with 33 additions and 395 deletions

View File

@ -20,7 +20,6 @@
#include "absl/strings/string_view.h"
#include "test/time_controller/simulated_process_thread.h"
#include "test/time_controller/simulated_task_queue.h"
#include "test/time_controller/simulated_thread.h"
namespace webrtc {
namespace {
@ -64,16 +63,6 @@ std::unique_ptr<ProcessThread> SimulatedTimeControllerImpl::CreateProcessThread(
return process_thread;
}
std::unique_ptr<rtc::Thread> SimulatedTimeControllerImpl::CreateThread(
const std::string& name,
std::unique_ptr<rtc::SocketServer> socket_server) {
rtc::CritScope lock(&lock_);
auto thread =
std::make_unique<SimulatedThread>(this, name, std::move(socket_server));
runners_.push_back(thread.get());
return thread;
}
void SimulatedTimeControllerImpl::YieldExecution() {
if (rtc::CurrentThreadId() == thread_id_) {
TaskQueueBase* yielding_from = TaskQueueBase::Current();
@ -94,9 +83,6 @@ void SimulatedTimeControllerImpl::YieldExecution() {
}
void SimulatedTimeControllerImpl::RunReadyRunners() {
// Using a dummy thread rather than nullptr to avoid implicit thread creation
// by Thread::Current().
SimulatedThread::CurrentThreadSetter set_current(dummy_thread_.get());
rtc::CritScope lock(&lock_);
RTC_DCHECK_EQ(rtc::CurrentThreadId(), thread_id_);
Timestamp current_time = CurrentTime();
@ -179,12 +165,6 @@ GlobalSimulatedTimeController::CreateProcessThread(const char* thread_name) {
return impl_.CreateProcessThread(thread_name);
}
std::unique_ptr<rtc::Thread> GlobalSimulatedTimeController::CreateThread(
const std::string& name,
std::unique_ptr<rtc::SocketServer> socket_server) {
return impl_.CreateThread(name, std::move(socket_server));
}
void GlobalSimulatedTimeController::AdvanceTime(TimeDelta duration) {
rtc::ScopedYieldPolicy yield_policy(&impl_);
Timestamp current_time = impl_.CurrentTime();