/* * Copyright 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #ifndef TEST_TIME_CONTROLLER_SIMULATED_TIME_CONTROLLER_H_ #define TEST_TIME_CONTROLLER_SIMULATED_TIME_CONTROLLER_H_ #include <list> #include <memory> #include <unordered_set> #include <utility> #include <vector> #include "absl/strings/string_view.h" #include "api/sequence_checker.h" #include "api/test/time_controller.h" #include "api/units/timestamp.h" #include "rtc_base/fake_clock.h" #include "rtc_base/platform_thread_types.h" #include "rtc_base/synchronization/mutex.h" #include "rtc_base/synchronization/yield_policy.h" namespace webrtc { namespace sim_time_impl { class SimulatedSequenceRunner { … }; class SimulatedTimeControllerImpl : public TaskQueueFactory, public rtc::YieldInterface { … }; } // namespace sim_time_impl // Used to satisfy sequence checkers for non task queue sequences. class TokenTaskQueue : public TaskQueueBase { … }; // TimeController implementation using completely simulated time. Task queues // and process threads created by this controller will run delayed activities // when AdvanceTime() is called. Overrides the global clock backing // rtc::TimeMillis() and rtc::TimeMicros(). Note that this is not thread safe // since it modifies global state. class GlobalSimulatedTimeController : public TimeController { … }; } // namespace webrtc #endif // TEST_TIME_CONTROLLER_SIMULATED_TIME_CONTROLLER_H_