Replace some usage of EventWrapper with rtc::Event.
Bug: webrtc:3380 Change-Id: Id33b19bf107273e6f838aa633784db73d02ae2c2 Reviewed-on: https://webrtc-review.googlesource.com/c/107888 Reviewed-by: Henrik Grunell <henrikg@webrtc.org> Reviewed-by: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Per Kjellander <perkj@webrtc.org> Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25407}
This commit is contained in:
@ -18,11 +18,11 @@
|
||||
#include "api/array_view.h"
|
||||
#include "modules/audio_processing/test/test_utils.h"
|
||||
#include "rtc_base/atomicops.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/numerics/safe_conversions.h"
|
||||
#include "rtc_base/platform_thread.h"
|
||||
#include "rtc_base/random.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
#include "system_wrappers/include/event_wrapper.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/testsupport/perf_test.h"
|
||||
|
||||
@ -391,7 +391,7 @@ class TimedThreadApiProcessor {
|
||||
class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
|
||||
public:
|
||||
CallSimulator()
|
||||
: test_complete_(EventWrapper::Create()),
|
||||
: test_complete_(false, false),
|
||||
render_thread_(
|
||||
new rtc::PlatformThread(RenderProcessorThreadFunc, this, "render")),
|
||||
capture_thread_(new rtc::PlatformThread(CaptureProcessorThreadFunc,
|
||||
@ -401,10 +401,10 @@ class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
|
||||
simulation_config_(static_cast<SimulationConfig>(GetParam())) {}
|
||||
|
||||
// Run the call simulation with a timeout.
|
||||
EventTypeWrapper Run() {
|
||||
bool Run() {
|
||||
StartThreads();
|
||||
|
||||
EventTypeWrapper result = test_complete_->Wait(kTestTimeout);
|
||||
bool result = test_complete_.Wait(kTestTimeout);
|
||||
|
||||
StopThreads();
|
||||
|
||||
@ -420,7 +420,7 @@ class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
|
||||
// done.
|
||||
bool MaybeEndTest() {
|
||||
if (frame_counters_.BothCountersExceedeThreshold(kMinNumFramesToProcess)) {
|
||||
test_complete_->Set();
|
||||
test_complete_.Set();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -570,7 +570,7 @@ class CallSimulator : public ::testing::TestWithParam<SimulationConfig> {
|
||||
}
|
||||
|
||||
// Event handler for the test.
|
||||
const std::unique_ptr<EventWrapper> test_complete_;
|
||||
rtc::Event test_complete_;
|
||||
|
||||
// Thread related variables.
|
||||
std::unique_ptr<rtc::PlatformThread> render_thread_;
|
||||
@ -619,7 +619,7 @@ const float CallSimulator::kCaptureInputFloatLevel = 0.03125f;
|
||||
// TODO(peah): Reactivate once issue 7712 has been resolved.
|
||||
TEST_P(CallSimulator, DISABLED_ApiCallDurationTest) {
|
||||
// Run test and verify that it did not time out.
|
||||
EXPECT_EQ(kEventSignaled, Run());
|
||||
EXPECT_TRUE(Run());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
|
Reference in New Issue
Block a user