Replace gunit.h macros with WaitUntil in call/
Bug: webrtc:381524905 Change-Id: I554e72f4dd9c79751b2b7fbc7ce393ffff01d676 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/372262 Auto-Submit: Evan Shrubsole <eshr@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43664}
This commit is contained in:
parent
4b96bfde96
commit
cfacd0dc52
@ -77,22 +77,29 @@ if (rtc_include_tests) {
|
|||||||
deps = [
|
deps = [
|
||||||
":resource_adaptation",
|
":resource_adaptation",
|
||||||
":resource_adaptation_test_utilities",
|
":resource_adaptation_test_utilities",
|
||||||
|
"../../api:rtc_error_matchers",
|
||||||
|
"../../api:rtp_parameters",
|
||||||
"../../api:scoped_refptr",
|
"../../api:scoped_refptr",
|
||||||
|
"../../api:sequence_checker",
|
||||||
"../../api/adaptation:resource_adaptation_api",
|
"../../api/adaptation:resource_adaptation_api",
|
||||||
"../../api/task_queue:default_task_queue_factory",
|
"../../api/task_queue:default_task_queue_factory",
|
||||||
"../../api/task_queue:task_queue",
|
"../../api/task_queue:task_queue",
|
||||||
|
"../../api/units:time_delta",
|
||||||
"../../api/video:video_adaptation",
|
"../../api/video:video_adaptation",
|
||||||
"../../api/video_codecs:video_codecs_api",
|
"../../api/video_codecs:video_codecs_api",
|
||||||
"../../rtc_base:checks",
|
"../../rtc_base:checks",
|
||||||
"../../rtc_base:gunit_helpers",
|
"../../rtc_base:gunit_helpers",
|
||||||
|
"../../rtc_base:macromagic",
|
||||||
"../../rtc_base:rtc_event",
|
"../../rtc_base:rtc_event",
|
||||||
"../../rtc_base:stringutils",
|
"../../rtc_base:stringutils",
|
||||||
"../../rtc_base:task_queue_for_test",
|
"../../rtc_base:task_queue_for_test",
|
||||||
|
"../../rtc_base:threading",
|
||||||
"../../rtc_base/synchronization:mutex",
|
"../../rtc_base/synchronization:mutex",
|
||||||
"../../test:field_trial",
|
"../../test:field_trial",
|
||||||
"../../test:rtc_expect_death",
|
"../../test:rtc_expect_death",
|
||||||
"../../test:scoped_key_value_config",
|
"../../test:scoped_key_value_config",
|
||||||
"../../test:test_support",
|
"../../test:test_support",
|
||||||
|
"../../test:wait_until",
|
||||||
"../../video/config:encoder_config",
|
"../../video/config:encoder_config",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,25 +10,36 @@
|
|||||||
|
|
||||||
#include "call/adaptation/resource_adaptation_processor.h"
|
#include "call/adaptation/resource_adaptation_processor.h"
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "api/adaptation/resource.h"
|
#include "api/adaptation/resource.h"
|
||||||
|
#include "api/rtp_parameters.h"
|
||||||
#include "api/scoped_refptr.h"
|
#include "api/scoped_refptr.h"
|
||||||
|
#include "api/sequence_checker.h"
|
||||||
|
#include "api/test/rtc_error_matchers.h"
|
||||||
|
#include "api/units/time_delta.h"
|
||||||
#include "api/video/video_adaptation_counters.h"
|
#include "api/video/video_adaptation_counters.h"
|
||||||
#include "call/adaptation/resource_adaptation_processor_interface.h"
|
|
||||||
#include "call/adaptation/test/fake_frame_rate_provider.h"
|
#include "call/adaptation/test/fake_frame_rate_provider.h"
|
||||||
#include "call/adaptation/test/fake_resource.h"
|
#include "call/adaptation/test/fake_resource.h"
|
||||||
#include "call/adaptation/video_source_restrictions.h"
|
#include "call/adaptation/video_source_restrictions.h"
|
||||||
|
#include "call/adaptation/video_stream_adapter.h"
|
||||||
#include "call/adaptation/video_stream_input_state_provider.h"
|
#include "call/adaptation/video_stream_input_state_provider.h"
|
||||||
#include "rtc_base/event.h"
|
#include "rtc_base/event.h"
|
||||||
#include "rtc_base/gunit.h"
|
|
||||||
#include "rtc_base/synchronization/mutex.h"
|
|
||||||
#include "rtc_base/task_queue_for_test.h"
|
#include "rtc_base/task_queue_for_test.h"
|
||||||
|
#include "rtc_base/thread.h"
|
||||||
|
#include "rtc_base/thread_annotations.h"
|
||||||
|
#include "test/gmock.h"
|
||||||
#include "test/gtest.h"
|
#include "test/gtest.h"
|
||||||
#include "test/scoped_key_value_config.h"
|
#include "test/scoped_key_value_config.h"
|
||||||
|
#include "test/wait_until.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
using ::testing::Eq;
|
||||||
|
|
||||||
const int kDefaultFrameRate = 30;
|
const int kDefaultFrameRate = 30;
|
||||||
const int kDefaultFrameSize = 1280 * 720;
|
const int kDefaultFrameSize = 1280 * 720;
|
||||||
constexpr TimeDelta kDefaultTimeout = TimeDelta::Seconds(5);
|
constexpr TimeDelta kDefaultTimeout = TimeDelta::Seconds(5);
|
||||||
@ -433,8 +444,11 @@ TEST_F(ResourceAdaptationProcessorTest,
|
|||||||
resource_task_queue.PostTask(
|
resource_task_queue.PostTask(
|
||||||
[&]() { resource_->SetUsageState(ResourceUsageState::kOveruse); });
|
[&]() { resource_->SetUsageState(ResourceUsageState::kOveruse); });
|
||||||
|
|
||||||
EXPECT_EQ_WAIT(1u, restrictions_listener_.restrictions_updated_count(),
|
EXPECT_THAT(
|
||||||
kDefaultTimeout.ms());
|
WaitUntil(
|
||||||
|
[&] { return restrictions_listener_.restrictions_updated_count(); },
|
||||||
|
Eq(1u)),
|
||||||
|
IsRtcOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ResourceAdaptationProcessorTest,
|
TEST_F(ResourceAdaptationProcessorTest,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user