| Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
|
| diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
|
| index 8349469669816264886b98ec4f9759bf5aa2c2b7..2dadb439b6d046178c8a55e5b63d0110c143ac3a 100644
|
| --- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
|
| +++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
|
| @@ -3927,7 +3927,7 @@ TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrcOnExistingReceivers) {
|
| class WebRtcVideoChannel2SimulcastTest : public testing::Test {
|
| public:
|
| WebRtcVideoChannel2SimulcastTest()
|
| - : fake_call_(webrtc::Call::Config(&event_log_)) {}
|
| + : fake_call_(webrtc::Call::Config(&event_log_)), last_ssrc_(0) {}
|
|
|
| void SetUp() override {
|
| engine_.Init();
|
| @@ -3942,9 +3942,15 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test {
|
| int capture_width,
|
| int capture_height,
|
| size_t num_configured_streams,
|
| - size_t expected_num_streams) {
|
| + size_t expected_num_streams,
|
| + bool screenshare) {
|
| cricket::VideoSendParameters parameters;
|
| + VideoOptions options;
|
| parameters.codecs.push_back(codec);
|
| + if (screenshare) {
|
| + parameters.conference_mode = true;
|
| + options.is_screencast = rtc::Optional<bool>(screenshare);
|
| + }
|
| ASSERT_TRUE(channel_->SetSendParameters(parameters));
|
|
|
| std::vector<uint32_t> ssrcs = MAKE_VECTOR(kSsrcs3);
|
| @@ -3957,7 +3963,7 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test {
|
| // expected simulcast layers.
|
| cricket::FakeVideoCapturer capturer;
|
| EXPECT_TRUE(
|
| - channel_->SetVideoSend(ssrcs.front(), true, nullptr, &capturer));
|
| + channel_->SetVideoSend(ssrcs.front(), true, &options, &capturer));
|
| EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(cricket::VideoFormat(
|
| capture_width, capture_height,
|
| cricket::VideoFormat::FpsToInterval(30),
|
| @@ -3970,7 +3976,7 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test {
|
|
|
| std::vector<webrtc::VideoStream> expected_streams = GetSimulcastConfig(
|
| num_configured_streams, capture_width, capture_height, 0, kDefaultQpMax,
|
| - kDefaultVideoMaxFramerate);
|
| + kDefaultVideoMaxFramerate, screenshare);
|
|
|
| ASSERT_EQ(expected_streams.size(), video_streams.size());
|
|
|
| @@ -4053,15 +4059,26 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test {
|
| };
|
|
|
| TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith2SimulcastStreams) {
|
| - VerifySimulcastSettings(cricket::VideoCodec("VP8"), 640, 360, 2, 2);
|
| + VerifySimulcastSettings(cricket::VideoCodec("VP8"), 640, 360, 2, 2, false);
|
| }
|
|
|
| TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) {
|
| - VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3);
|
| + VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3, false);
|
| }
|
|
|
| // Test that we normalize send codec format size in simulcast.
|
| TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
|
| - VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2);
|
| + VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2, false);
|
| +}
|
| +
|
| +TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForScreenshare) {
|
| + VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true);
|
| }
|
| +
|
| +TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) {
|
| + webrtc::test::ScopedFieldTrials override_field_trials_(
|
| + "WebRTC-SimulcastScreenshare/Enabled/");
|
| + VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true);
|
| +}
|
| +
|
| } // namespace cricket
|
|
|