xref: /aosp_15_r20/external/webrtc/video/pc_full_stack_tests.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 #include <memory>
11 #include <string>
12 #include <utility>
13 #include <vector>
14 
15 #include "api/media_stream_interface.h"
16 #include "api/test/create_network_emulation_manager.h"
17 #include "api/test/create_peer_connection_quality_test_frame_generator.h"
18 #include "api/test/create_peerconnection_quality_test_fixture.h"
19 #include "api/test/frame_generator_interface.h"
20 #include "api/test/metrics/global_metrics_logger_and_exporter.h"
21 #include "api/test/network_emulation_manager.h"
22 #include "api/test/pclf/media_configuration.h"
23 #include "api/test/pclf/media_quality_test_params.h"
24 #include "api/test/pclf/peer_configurer.h"
25 #include "api/test/peerconnection_quality_test_fixture.h"
26 #include "api/test/simulated_network.h"
27 #include "api/test/time_controller.h"
28 #include "api/video_codecs/vp9_profile.h"
29 #include "call/simulated_network.h"
30 #include "modules/video_coding/codecs/vp9/include/vp9.h"
31 #include "system_wrappers/include/field_trial.h"
32 #include "test/field_trial.h"
33 #include "test/gtest.h"
34 #include "test/pc/e2e/network_quality_metrics_reporter.h"
35 #include "test/testsupport/file_utils.h"
36 
37 namespace webrtc {
38 
39 using ::webrtc::webrtc_pc_e2e::AudioConfig;
40 using ::webrtc::webrtc_pc_e2e::EmulatedSFUConfig;
41 using ::webrtc::webrtc_pc_e2e::PeerConfigurer;
42 using ::webrtc::webrtc_pc_e2e::RunParams;
43 using ::webrtc::webrtc_pc_e2e::ScreenShareConfig;
44 using ::webrtc::webrtc_pc_e2e::VideoCodecConfig;
45 using ::webrtc::webrtc_pc_e2e::VideoConfig;
46 using ::webrtc::webrtc_pc_e2e::VideoSimulcastConfig;
47 
48 namespace {
49 
50 constexpr int kTestDurationSec = 45;
51 
52 std::unique_ptr<webrtc_pc_e2e::PeerConnectionE2EQualityTestFixture>
CreateTestFixture(const std::string & test_case_name,TimeController & time_controller,std::pair<EmulatedNetworkManagerInterface *,EmulatedNetworkManagerInterface * > network_links,rtc::FunctionView<void (PeerConfigurer *)> alice_configurer,rtc::FunctionView<void (PeerConfigurer *)> bob_configurer)53 CreateTestFixture(const std::string& test_case_name,
54                   TimeController& time_controller,
55                   std::pair<EmulatedNetworkManagerInterface*,
56                             EmulatedNetworkManagerInterface*> network_links,
57                   rtc::FunctionView<void(PeerConfigurer*)> alice_configurer,
58                   rtc::FunctionView<void(PeerConfigurer*)> bob_configurer) {
59   auto fixture = webrtc_pc_e2e::CreatePeerConnectionE2EQualityTestFixture(
60       test_case_name, time_controller, /*audio_quality_analyzer=*/nullptr,
61       /*video_quality_analyzer=*/nullptr);
62   auto alice = std::make_unique<PeerConfigurer>(
63       network_links.first->network_dependencies());
64   auto bob = std::make_unique<PeerConfigurer>(
65       network_links.second->network_dependencies());
66   alice_configurer(alice.get());
67   bob_configurer(bob.get());
68   fixture->AddPeer(std::move(alice));
69   fixture->AddPeer(std::move(bob));
70   fixture->AddQualityMetricsReporter(
71       std::make_unique<webrtc_pc_e2e::NetworkQualityMetricsReporter>(
72           network_links.first, network_links.second,
73           test::GetGlobalMetricsLogger()));
74   return fixture;
75 }
76 
77 // Takes the current active field trials set, and appends some new trials.
AppendFieldTrials(std::string new_trial_string)78 std::string AppendFieldTrials(std::string new_trial_string) {
79   return std::string(field_trial::GetFieldTrialString()) + new_trial_string;
80 }
81 
ClipNameToClipPath(const char * clip_name)82 std::string ClipNameToClipPath(const char* clip_name) {
83   return test::ResourcePath(clip_name, "yuv");
84 }
85 
86 }  // namespace
87 
88 struct PCFullStackTestParams {
89   bool use_network_thread_as_worker_thread = false;
90   std::string field_trials;
91   std::string test_case_name_postfix;
92 };
93 
ParameterizedTestParams()94 std::vector<PCFullStackTestParams> ParameterizedTestParams() {
95   return {// Run with default parameters and field trials.
96           {},
97           // Use the network thread as worker thread.
98           // Use the worker thread for sending packets.
99           // https://bugs.chromium.org/p/webrtc/issues/detail?id=14502
100           {.use_network_thread_as_worker_thread = true,
101            .field_trials = "WebRTC-SendPacketsOnWorkerThread/Enabled/",
102            .test_case_name_postfix = "_ReducedThreads"}};
103 }
104 
105 class ParameterizedPCFullStackTest
106     : public ::testing::TestWithParam<PCFullStackTestParams> {
107  public:
ParameterizedPCFullStackTest()108   ParameterizedPCFullStackTest() : field_trials_(GetParam().field_trials) {}
109 
110  private:
111   test::ScopedFieldTrials field_trials_;
112 };
113 
114 INSTANTIATE_TEST_SUITE_P(
115     ParameterizedPCFullStackTest,
116     ParameterizedPCFullStackTest,
117     testing::ValuesIn(ParameterizedTestParams()),
__anon1c6224a30202(const testing::TestParamInfo<PCFullStackTestParams>& info) 118     [](const testing::TestParamInfo<PCFullStackTestParams>& info) {
119       if (info.param.test_case_name_postfix.empty())
120         return std::string("Default");
121       return info.param.test_case_name_postfix;
122     });
123 
124 #if defined(RTC_ENABLE_VP9)
TEST(PCFullStackTest,Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_VP9)125 TEST(PCFullStackTest, Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_VP9) {
126   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
127       CreateNetworkEmulationManager();
128   auto fixture = CreateTestFixture(
129       "pc_foreman_cif_net_delay_0_0_plr_0_VP9",
130       *network_emulation_manager->time_controller(),
131       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
132           BuiltInNetworkBehaviorConfig()),
133       [](PeerConfigurer* alice) {
134         VideoConfig video(352, 288, 30);
135         video.stream_label = "alice-video";
136         auto frame_generator = CreateFromYuvFileFrameGenerator(
137             video, ClipNameToClipPath("foreman_cif"));
138         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
139         alice->SetVideoCodecs({VideoCodecConfig(
140             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
141                 {kVP9FmtpProfileId,
142                  VP9ProfileToString(VP9Profile::kProfile0)}})});
143       },
144       [](PeerConfigurer* bob) {
145         bob->SetVideoCodecs({VideoCodecConfig(
146             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
147                 {kVP9FmtpProfileId,
148                  VP9ProfileToString(VP9Profile::kProfile0)}})});
149       });
150   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
151 }
152 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_VP9_Generic_Descriptor)153 TEST(PCGenericDescriptorTest,
154      Pc_Foreman_Cif_Delay_50_0_Plr_5_VP9_Generic_Descriptor) {
155   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
156       CreateNetworkEmulationManager();
157   BuiltInNetworkBehaviorConfig config;
158   config.loss_percent = 5;
159   config.queue_delay_ms = 50;
160   auto fixture = CreateTestFixture(
161       "pc_foreman_cif_delay_50_0_plr_5_VP9_generic_descriptor",
162       *network_emulation_manager->time_controller(),
163       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
164       [](PeerConfigurer* alice) {
165         VideoConfig video(352, 288, 30);
166         video.stream_label = "alice-video";
167         auto frame_generator = CreateFromYuvFileFrameGenerator(
168             video, ClipNameToClipPath("foreman_cif"));
169         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
170         alice->SetVideoCodecs({VideoCodecConfig(
171             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
172                 {kVP9FmtpProfileId,
173                  VP9ProfileToString(VP9Profile::kProfile0)}})});
174       },
175       [](PeerConfigurer* bob) {
176         bob->SetVideoCodecs({VideoCodecConfig(
177             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
178                 {kVP9FmtpProfileId,
179                  VP9ProfileToString(VP9Profile::kProfile0)}})});
180       });
181   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
182 }
183 
184 // VP9 2nd profile isn't supported on android arm and arm 64.
185 #if (defined(WEBRTC_ANDROID) &&                                   \
186      (defined(WEBRTC_ARCH_ARM64) || defined(WEBRTC_ARCH_ARM))) || \
187     (defined(WEBRTC_IOS) && defined(WEBRTC_ARCH_ARM64))
188 #define MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2 \
189   DISABLED_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2
190 #else
191 #define MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2 \
192   Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2
193 #endif
TEST(PCFullStackTest,MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2)194 TEST(PCFullStackTest, MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2) {
195   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
196       CreateNetworkEmulationManager();
197   auto fixture = CreateTestFixture(
198       "pc_generator_net_delay_0_0_plr_0_VP9Profile2",
199       *network_emulation_manager->time_controller(),
200       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
201           BuiltInNetworkBehaviorConfig()),
202       [](PeerConfigurer* alice) {
203         VideoConfig video(352, 288, 30);
204         video.stream_label = "alice-video";
205         auto frame_generator = CreateSquareFrameGenerator(
206             video, test::FrameGeneratorInterface::OutputType::kI010);
207         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
208         alice->SetVideoCodecs({VideoCodecConfig(
209             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
210                 {kVP9FmtpProfileId,
211                  VP9ProfileToString(VP9Profile::kProfile2)}})});
212       },
213       [](PeerConfigurer* bob) {
214         bob->SetVideoCodecs({VideoCodecConfig(
215             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
216                 {kVP9FmtpProfileId,
217                  VP9ProfileToString(VP9Profile::kProfile2)}})});
218       });
219   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
220 }
221 
222 /*
223 // TODO(bugs.webrtc.org/10639) migrate commented out test, when required
224 // functionality will be supported in PeerConnection level framework.
225 TEST(PCFullStackTest, ForemanCifWithoutPacketLossMultiplexI420Frame) {
226   auto fixture = CreateVideoQualityTestFixture();
227   ParamsWithLogging foreman_cif;
228   foreman_cif.call.send_side_bwe = true;
229   foreman_cif.video[0] = {
230       true,        352,    288,    30,
231       700000,      700000, 700000, false,
232       "multiplex", 1,      0,      0,
233       false,       false,  false,  ClipNameToClipPath("foreman_cif")};
234   foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
235                           kTestDurationSec};
236   fixture->RunWithAnalyzer(foreman_cif);
237 }
238 
239 TEST(PCFullStackTest, GeneratorWithoutPacketLossMultiplexI420AFrame) {
240   auto fixture = CreateVideoQualityTestFixture();
241 
242   ParamsWithLogging generator;
243   generator.call.send_side_bwe = true;
244   generator.video[0] = {
245       true,        352, 288, 30, 700000, 700000, 700000, false,
246       "multiplex", 1,   0,   0,  false,  false,  false,  "GeneratorI420A"};
247   generator.analyzer = {"generator_net_delay_0_0_plr_0_Multiplex", 0.0, 0.0,
248                         kTestDurationSec};
249   fixture->RunWithAnalyzer(generator);
250 }
251 */
252 #endif  // defined(RTC_ENABLE_VP9)
253 
TEST(PCFullStackTest,Pc_Net_Delay_0_0_Plr_0)254 TEST(PCFullStackTest, Pc_Net_Delay_0_0_Plr_0) {
255   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
256       CreateNetworkEmulationManager();
257   auto fixture = CreateTestFixture(
258       "pc_net_delay_0_0_plr_0", *network_emulation_manager->time_controller(),
259       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
260           BuiltInNetworkBehaviorConfig()),
261       [](PeerConfigurer* alice) {
262         VideoConfig video(176, 144, 30);
263         video.stream_label = "alice-video";
264         auto frame_generator = CreateFromYuvFileFrameGenerator(
265             video, ClipNameToClipPath("paris_qcif"));
266         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
267       },
268       [](PeerConfigurer* bob) {});
269   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
270 }
271 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_Generic_Descriptor)272 TEST(PCGenericDescriptorTest,
273      Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_Generic_Descriptor) {
274   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
275       CreateNetworkEmulationManager();
276   auto fixture = CreateTestFixture(
277       "pc_foreman_cif_net_delay_0_0_plr_0_generic_descriptor",
278       *network_emulation_manager->time_controller(),
279       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
280           BuiltInNetworkBehaviorConfig()),
281       [](PeerConfigurer* alice) {
282         VideoConfig video(352, 288, 30);
283         video.stream_label = "alice-video";
284         auto frame_generator = CreateFromYuvFileFrameGenerator(
285             video, ClipNameToClipPath("foreman_cif"));
286         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
287       },
288       [](PeerConfigurer* bob) {});
289   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
290 }
291 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_Generic_Descriptor)292 TEST(PCGenericDescriptorTest,
293      Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_Generic_Descriptor) {
294   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
295       CreateNetworkEmulationManager();
296   BuiltInNetworkBehaviorConfig config;
297   auto fixture = CreateTestFixture(
298       "pc_foreman_cif_30kbps_net_delay_0_0_plr_0_generic_descriptor",
299       *network_emulation_manager->time_controller(),
300       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
301       [](PeerConfigurer* alice) {
302         VideoConfig video(352, 288, 10);
303         video.stream_label = "alice-video";
304         auto frame_generator = CreateFromYuvFileFrameGenerator(
305             video, ClipNameToClipPath("foreman_cif"));
306         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
307 
308         BitrateSettings bitrate_settings;
309         bitrate_settings.min_bitrate_bps = 30000;
310         bitrate_settings.start_bitrate_bps = 30000;
311         bitrate_settings.max_bitrate_bps = 30000;
312         alice->SetBitrateSettings(bitrate_settings);
313       },
314       [](PeerConfigurer* bob) {});
315   RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
316   fixture->Run(std::move(run_params));
317 }
318 
319 // Link capacity below default start rate.
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_150kbps_Net_Delay_0_0_Plr_0)320 TEST(PCFullStackTest, Pc_Foreman_Cif_Link_150kbps_Net_Delay_0_0_Plr_0) {
321   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
322       CreateNetworkEmulationManager();
323   BuiltInNetworkBehaviorConfig config;
324   config.link_capacity_kbps = 150;
325   auto fixture = CreateTestFixture(
326       "pc_foreman_cif_link_150kbps_net_delay_0_0_plr_0",
327       *network_emulation_manager->time_controller(),
328       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
329       [](PeerConfigurer* alice) {
330         VideoConfig video(352, 288, 30);
331         video.stream_label = "alice-video";
332         auto frame_generator = CreateFromYuvFileFrameGenerator(
333             video, ClipNameToClipPath("foreman_cif"));
334         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
335       },
336       [](PeerConfigurer* bob) {});
337   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
338 }
339 
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_130kbps_Delay100ms_Loss1_Ulpfec)340 TEST(PCFullStackTest, Pc_Foreman_Cif_Link_130kbps_Delay100ms_Loss1_Ulpfec) {
341   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
342       CreateNetworkEmulationManager();
343   BuiltInNetworkBehaviorConfig config;
344   config.link_capacity_kbps = 130;
345   config.queue_delay_ms = 100;
346   config.loss_percent = 1;
347   auto fixture = CreateTestFixture(
348       "pc_foreman_cif_link_130kbps_delay100ms_loss1_ulpfec",
349       *network_emulation_manager->time_controller(),
350       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
351       [](PeerConfigurer* alice) {
352         VideoConfig video(352, 288, 30);
353         video.stream_label = "alice-video";
354         auto frame_generator = CreateFromYuvFileFrameGenerator(
355             video, ClipNameToClipPath("foreman_cif"));
356         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
357         alice->SetUseUlpFEC(true);
358       },
359       [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
360   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
361 }
362 
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_50kbps_Delay100ms_Loss1_Ulpfec)363 TEST(PCFullStackTest, Pc_Foreman_Cif_Link_50kbps_Delay100ms_Loss1_Ulpfec) {
364   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
365       CreateNetworkEmulationManager();
366   BuiltInNetworkBehaviorConfig config;
367   config.link_capacity_kbps = 50;
368   config.queue_delay_ms = 100;
369   config.loss_percent = 1;
370   auto fixture = CreateTestFixture(
371       "pc_foreman_cif_link_50kbps_delay100ms_loss1_ulpfec",
372       *network_emulation_manager->time_controller(),
373       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
374       [](PeerConfigurer* alice) {
375         VideoConfig video(352, 288, 30);
376         video.stream_label = "alice-video";
377         auto frame_generator = CreateFromYuvFileFrameGenerator(
378             video, ClipNameToClipPath("foreman_cif"));
379         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
380         alice->SetUseUlpFEC(true);
381       },
382       [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
383   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
384 }
385 
386 // Restricted network and encoder overproducing by 30%.
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_150kbps_Delay100ms_30pkts_Queue_Overshoot30)387 TEST(PCFullStackTest,
388      Pc_Foreman_Cif_Link_150kbps_Delay100ms_30pkts_Queue_Overshoot30) {
389   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
390       CreateNetworkEmulationManager();
391   BuiltInNetworkBehaviorConfig config;
392   config.link_capacity_kbps = 150;
393   config.queue_length_packets = 30;
394   config.queue_delay_ms = 100;
395   auto fixture = CreateTestFixture(
396       "pc_foreman_cif_link_150kbps_delay100ms_30pkts_queue_overshoot30",
397       *network_emulation_manager->time_controller(),
398       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
399       [](PeerConfigurer* alice) {
400         VideoConfig video(352, 288, 30);
401         video.stream_label = "alice-video";
402         auto frame_generator = CreateFromYuvFileFrameGenerator(
403             video, ClipNameToClipPath("foreman_cif"));
404         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
405         alice->SetVideoEncoderBitrateMultiplier(1.30);
406       },
407       [](PeerConfigurer* bob) { bob->SetVideoEncoderBitrateMultiplier(1.30); });
408   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
409 }
410 
411 // Weak 3G-style link: 250kbps, 1% loss, 100ms delay, 15 packets queue.
412 // Packet rate and loss are low enough that loss will happen with ~3s interval.
413 // This triggers protection overhead to toggle between zero and non-zero.
414 // Link queue is restrictive enough to trigger loss on probes.
TEST(PCFullStackTest,Pc_Foreman_Cif_Link_250kbps_Delay100ms_10pkts_Loss1)415 TEST(PCFullStackTest, Pc_Foreman_Cif_Link_250kbps_Delay100ms_10pkts_Loss1) {
416   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
417       CreateNetworkEmulationManager();
418   BuiltInNetworkBehaviorConfig config;
419   config.link_capacity_kbps = 250;
420   config.queue_length_packets = 10;
421   config.queue_delay_ms = 100;
422   config.loss_percent = 1;
423   auto fixture = CreateTestFixture(
424       "pc_foreman_cif_link_250kbps_delay100ms_10pkts_loss1",
425       *network_emulation_manager->time_controller(),
426       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
427       [](PeerConfigurer* alice) {
428         VideoConfig video(352, 288, 30);
429         video.stream_label = "alice-video";
430         auto frame_generator = CreateFromYuvFileFrameGenerator(
431             video, ClipNameToClipPath("foreman_cif"));
432         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
433         alice->SetVideoEncoderBitrateMultiplier(1.30);
434       },
435       [](PeerConfigurer* bob) { bob->SetVideoEncoderBitrateMultiplier(1.30); });
436   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
437 }
438 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_Generic_Descriptor)439 TEST(PCGenericDescriptorTest,
440      Pc_Foreman_Cif_Delay_50_0_Plr_5_Generic_Descriptor) {
441   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
442       CreateNetworkEmulationManager();
443   BuiltInNetworkBehaviorConfig config;
444   config.loss_percent = 5;
445   config.queue_delay_ms = 50;
446   auto fixture = CreateTestFixture(
447       "pc_foreman_cif_delay_50_0_plr_5_generic_descriptor",
448       *network_emulation_manager->time_controller(),
449       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
450       [](PeerConfigurer* alice) {
451         VideoConfig video(352, 288, 30);
452         video.stream_label = "alice-video";
453         auto frame_generator = CreateFromYuvFileFrameGenerator(
454             video, ClipNameToClipPath("foreman_cif"));
455         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
456       },
457       [](PeerConfigurer* bob) {});
458   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
459 }
460 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_Ulpfec_Generic_Descriptor)461 TEST(PCGenericDescriptorTest,
462      Pc_Foreman_Cif_Delay_50_0_Plr_5_Ulpfec_Generic_Descriptor) {
463   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
464       CreateNetworkEmulationManager();
465   BuiltInNetworkBehaviorConfig config;
466   config.loss_percent = 5;
467   config.queue_delay_ms = 50;
468   auto fixture = CreateTestFixture(
469       "pc_foreman_cif_delay_50_0_plr_5_ulpfec_generic_descriptor",
470       *network_emulation_manager->time_controller(),
471       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
472       [](PeerConfigurer* alice) {
473         VideoConfig video(352, 288, 30);
474         video.stream_label = "alice-video";
475         auto frame_generator = CreateFromYuvFileFrameGenerator(
476             video, ClipNameToClipPath("foreman_cif"));
477         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
478         alice->SetUseUlpFEC(true);
479       },
480       [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
481   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
482 }
483 
TEST(PCFullStackTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_Flexfec)484 TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_Flexfec) {
485   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
486       CreateNetworkEmulationManager();
487   BuiltInNetworkBehaviorConfig config;
488   config.loss_percent = 5;
489   config.queue_delay_ms = 50;
490   auto fixture = CreateTestFixture(
491       "pc_foreman_cif_delay_50_0_plr_5_flexfec",
492       *network_emulation_manager->time_controller(),
493       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
494       [](PeerConfigurer* alice) {
495         VideoConfig video(352, 288, 30);
496         video.stream_label = "alice-video";
497         auto frame_generator = CreateFromYuvFileFrameGenerator(
498             video, ClipNameToClipPath("foreman_cif"));
499         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
500         alice->SetUseFlexFEC(true);
501       },
502       [](PeerConfigurer* bob) { bob->SetUseFlexFEC(true); });
503   RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
504   run_params.enable_flex_fec_support = true;
505   fixture->Run(std::move(run_params));
506 }
507 
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Flexfec)508 TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Flexfec) {
509   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
510       CreateNetworkEmulationManager();
511   BuiltInNetworkBehaviorConfig config;
512   config.loss_percent = 3;
513   config.link_capacity_kbps = 500;
514   config.queue_delay_ms = 50;
515   auto fixture = CreateTestFixture(
516       "pc_foreman_cif_500kbps_delay_50_0_plr_3_flexfec",
517       *network_emulation_manager->time_controller(),
518       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
519       [](PeerConfigurer* alice) {
520         VideoConfig video(352, 288, 30);
521         video.stream_label = "alice-video";
522         auto frame_generator = CreateFromYuvFileFrameGenerator(
523             video, ClipNameToClipPath("foreman_cif"));
524         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
525         alice->SetUseFlexFEC(true);
526       },
527       [](PeerConfigurer* bob) { bob->SetUseFlexFEC(true); });
528   RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
529   run_params.enable_flex_fec_support = true;
530   fixture->Run(std::move(run_params));
531 }
532 
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Ulpfec)533 TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Ulpfec) {
534   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
535       CreateNetworkEmulationManager();
536   BuiltInNetworkBehaviorConfig config;
537   config.loss_percent = 3;
538   config.link_capacity_kbps = 500;
539   config.queue_delay_ms = 50;
540   auto fixture = CreateTestFixture(
541       "pc_foreman_cif_500kbps_delay_50_0_plr_3_ulpfec",
542       *network_emulation_manager->time_controller(),
543       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
544       [](PeerConfigurer* alice) {
545         VideoConfig video(352, 288, 30);
546         video.stream_label = "alice-video";
547         auto frame_generator = CreateFromYuvFileFrameGenerator(
548             video, ClipNameToClipPath("foreman_cif"));
549         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
550         alice->SetUseUlpFEC(true);
551       },
552       [](PeerConfigurer* bob) { bob->SetUseUlpFEC(true); });
553   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
554 }
555 
556 #if defined(WEBRTC_USE_H264)
TEST(PCFullStackTest,Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_H264)557 TEST(PCFullStackTest, Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_H264) {
558   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
559       CreateNetworkEmulationManager();
560   auto fixture = CreateTestFixture(
561       "pc_foreman_cif_net_delay_0_0_plr_0_H264",
562       *network_emulation_manager->time_controller(),
563       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
564           BuiltInNetworkBehaviorConfig()),
565       [](PeerConfigurer* alice) {
566         VideoConfig video(352, 288, 30);
567         video.stream_label = "alice-video";
568         auto frame_generator = CreateFromYuvFileFrameGenerator(
569             video, ClipNameToClipPath("foreman_cif"));
570         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
571         alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
572       },
573       [](PeerConfigurer* bob) {
574         bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
575       });
576   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
577 }
578 
TEST(PCFullStackTest,Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_H264)579 TEST(PCFullStackTest, Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_H264) {
580   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
581       CreateNetworkEmulationManager();
582   BuiltInNetworkBehaviorConfig config;
583   auto fixture = CreateTestFixture(
584       "pc_foreman_cif_30kbps_net_delay_0_0_plr_0_H264",
585       *network_emulation_manager->time_controller(),
586       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
587       [](PeerConfigurer* alice) {
588         VideoConfig video(352, 288, 10);
589         video.stream_label = "alice-video";
590         auto frame_generator = CreateFromYuvFileFrameGenerator(
591             video, ClipNameToClipPath("foreman_cif"));
592         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
593 
594         BitrateSettings bitrate_settings;
595         bitrate_settings.min_bitrate_bps = 30000;
596         bitrate_settings.start_bitrate_bps = 30000;
597         bitrate_settings.max_bitrate_bps = 30000;
598         alice->SetBitrateSettings(bitrate_settings);
599         alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
600       },
601       [](PeerConfigurer* bob) {
602         bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
603       });
604   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
605 }
606 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Generic_Descriptor)607 TEST(PCGenericDescriptorTest,
608      Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Generic_Descriptor) {
609   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
610       CreateNetworkEmulationManager();
611   BuiltInNetworkBehaviorConfig config;
612   config.loss_percent = 5;
613   config.queue_delay_ms = 50;
614   auto fixture = CreateTestFixture(
615       "pc_foreman_cif_delay_50_0_plr_5_H264_generic_descriptor",
616       *network_emulation_manager->time_controller(),
617       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
618       [](PeerConfigurer* alice) {
619         VideoConfig video(352, 288, 30);
620         video.stream_label = "alice-video";
621         auto frame_generator = CreateFromYuvFileFrameGenerator(
622             video, ClipNameToClipPath("foreman_cif"));
623         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
624         alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
625       },
626       [](PeerConfigurer* bob) {
627         bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
628       });
629   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
630 }
631 
TEST(PCFullStackTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Sps_Pps_Idr)632 TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Sps_Pps_Idr) {
633   test::ScopedFieldTrials override_field_trials(
634       AppendFieldTrials("WebRTC-SpsPpsIdrIsH264Keyframe/Enabled/"));
635 
636   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
637       CreateNetworkEmulationManager();
638   BuiltInNetworkBehaviorConfig config;
639   config.loss_percent = 5;
640   config.queue_delay_ms = 50;
641   auto fixture = CreateTestFixture(
642       "pc_foreman_cif_delay_50_0_plr_5_H264_sps_pps_idr",
643       *network_emulation_manager->time_controller(),
644       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
645       [](PeerConfigurer* alice) {
646         VideoConfig video(352, 288, 30);
647         video.stream_label = "alice-video";
648         auto frame_generator = CreateFromYuvFileFrameGenerator(
649             video, ClipNameToClipPath("foreman_cif"));
650         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
651         alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
652       },
653       [](PeerConfigurer* bob) {
654         bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
655       });
656   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
657 }
658 
TEST(PCFullStackTest,Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Flexfec)659 TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Flexfec) {
660   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
661       CreateNetworkEmulationManager();
662   BuiltInNetworkBehaviorConfig config;
663   config.loss_percent = 5;
664   config.queue_delay_ms = 50;
665   auto fixture = CreateTestFixture(
666       "pc_foreman_cif_delay_50_0_plr_5_H264_flexfec",
667       *network_emulation_manager->time_controller(),
668       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
669       [](PeerConfigurer* alice) {
670         VideoConfig video(352, 288, 30);
671         video.stream_label = "alice-video";
672         auto frame_generator = CreateFromYuvFileFrameGenerator(
673             video, ClipNameToClipPath("foreman_cif"));
674         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
675         alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
676         alice->SetUseFlexFEC(true);
677       },
678       [](PeerConfigurer* bob) {
679         bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
680         bob->SetUseFlexFEC(true);
681       });
682   RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
683   run_params.enable_flex_fec_support = true;
684   fixture->Run(std::move(run_params));
685 }
686 
687 // Ulpfec with H264 is an unsupported combination, so this test is only useful
688 // for debugging. It is therefore disabled by default.
TEST(PCFullStackTest,DISABLED_Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Ulpfec)689 TEST(PCFullStackTest, DISABLED_Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Ulpfec) {
690   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
691       CreateNetworkEmulationManager();
692   BuiltInNetworkBehaviorConfig config;
693   config.loss_percent = 5;
694   config.queue_delay_ms = 50;
695   auto fixture = CreateTestFixture(
696       "pc_foreman_cif_delay_50_0_plr_5_H264_ulpfec",
697       *network_emulation_manager->time_controller(),
698       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
699       [](PeerConfigurer* alice) {
700         VideoConfig video(352, 288, 30);
701         video.stream_label = "alice-video";
702         auto frame_generator = CreateFromYuvFileFrameGenerator(
703             video, ClipNameToClipPath("foreman_cif"));
704         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
705         alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
706         alice->SetUseUlpFEC(true);
707       },
708       [](PeerConfigurer* bob) {
709         bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)});
710         bob->SetUseUlpFEC(true);
711       });
712   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
713 }
714 #endif  // defined(WEBRTC_USE_H264)
715 
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps)716 TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps) {
717   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
718       CreateNetworkEmulationManager();
719   BuiltInNetworkBehaviorConfig config;
720   config.queue_length_packets = 0;
721   config.queue_delay_ms = 0;
722   config.link_capacity_kbps = 500;
723   auto fixture = CreateTestFixture(
724       "pc_foreman_cif_500kbps", *network_emulation_manager->time_controller(),
725       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
726       [](PeerConfigurer* alice) {
727         VideoConfig video(352, 288, 30);
728         video.stream_label = "alice-video";
729         auto frame_generator = CreateFromYuvFileFrameGenerator(
730             video, ClipNameToClipPath("foreman_cif"));
731         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
732       },
733       [](PeerConfigurer* bob) {});
734   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
735 }
736 
TEST_P(ParameterizedPCFullStackTest,Pc_Foreman_Cif_500kbps_32pkts_Queue)737 TEST_P(ParameterizedPCFullStackTest, Pc_Foreman_Cif_500kbps_32pkts_Queue) {
738   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
739       CreateNetworkEmulationManager();
740   BuiltInNetworkBehaviorConfig config;
741   config.queue_length_packets = 32;
742   config.queue_delay_ms = 0;
743   config.link_capacity_kbps = 500;
744   auto fixture = CreateTestFixture(
745       "pc_foreman_cif_500kbps_32pkts_queue" + GetParam().test_case_name_postfix,
746       *network_emulation_manager->time_controller(),
747       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
748       [](PeerConfigurer* alice) {
749         VideoConfig video(352, 288, 30);
750         video.stream_label = "alice-video";
751         auto frame_generator = CreateFromYuvFileFrameGenerator(
752             video, ClipNameToClipPath("foreman_cif"));
753         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
754         if (GetParam().use_network_thread_as_worker_thread) {
755           alice->SetUseNetworkThreadAsWorkerThread();
756         }
757       },
758       [](PeerConfigurer* bob) {
759         if (GetParam().use_network_thread_as_worker_thread) {
760           bob->SetUseNetworkThreadAsWorkerThread();
761         }
762       });
763   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
764 }
765 
TEST(PCFullStackTest,Pc_Foreman_Cif_500kbps_100ms)766 TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_100ms) {
767   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
768       CreateNetworkEmulationManager();
769   BuiltInNetworkBehaviorConfig config;
770   config.queue_length_packets = 0;
771   config.queue_delay_ms = 100;
772   config.link_capacity_kbps = 500;
773   auto fixture = CreateTestFixture(
774       "pc_foreman_cif_500kbps_100ms",
775       *network_emulation_manager->time_controller(),
776       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
777       [](PeerConfigurer* alice) {
778         VideoConfig video(352, 288, 30);
779         video.stream_label = "alice-video";
780         auto frame_generator = CreateFromYuvFileFrameGenerator(
781             video, ClipNameToClipPath("foreman_cif"));
782         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
783       },
784       [](PeerConfigurer* bob) {});
785   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
786 }
787 
TEST(PCGenericDescriptorTest,Pc_Foreman_Cif_500kbps_100ms_32pkts_Queue_Generic_Descriptor)788 TEST(PCGenericDescriptorTest,
789      Pc_Foreman_Cif_500kbps_100ms_32pkts_Queue_Generic_Descriptor) {
790   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
791       CreateNetworkEmulationManager();
792   BuiltInNetworkBehaviorConfig config;
793   config.queue_length_packets = 32;
794   config.queue_delay_ms = 100;
795   config.link_capacity_kbps = 500;
796   auto fixture = CreateTestFixture(
797       "pc_foreman_cif_500kbps_100ms_32pkts_queue_generic_descriptor",
798       *network_emulation_manager->time_controller(),
799       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
800       [](PeerConfigurer* alice) {
801         VideoConfig video(352, 288, 30);
802         video.stream_label = "alice-video";
803         auto frame_generator = CreateFromYuvFileFrameGenerator(
804             video, ClipNameToClipPath("foreman_cif"));
805         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
806       },
807       [](PeerConfigurer* bob) {});
808   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
809 }
810 
811 /*
812 // TODO(bugs.webrtc.org/10639) we need to disable send side bwe, but it isn't
813 // supported in PC level framework.
814 TEST(PCFullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) {
815   auto fixture = CreateVideoQualityTestFixture();
816   ParamsWithLogging foreman_cif;
817   foreman_cif.call.send_side_bwe = false;
818   foreman_cif.video[0] = {
819       true,  352,    288,     30,
820       30000, 500000, 2000000, false,
821       "VP8", 1,      0,       0,
822       false, false,  true,    ClipNameToClipPath("foreman_cif")};
823   foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe",
824                           0.0, 0.0, kTestDurationSec};
825   foreman_cif.config->queue_length_packets = 32;
826   foreman_cif.config->queue_delay_ms = 100;
827   foreman_cif.config->link_capacity_kbps = 500;
828   fixture->RunWithAnalyzer(foreman_cif);
829 }
830 */
831 
TEST(PCFullStackTest,Pc_Foreman_Cif_1000kbps_100ms_32pkts_Queue)832 TEST(PCFullStackTest, Pc_Foreman_Cif_1000kbps_100ms_32pkts_Queue) {
833   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
834       CreateNetworkEmulationManager();
835   BuiltInNetworkBehaviorConfig config;
836   config.queue_length_packets = 32;
837   config.queue_delay_ms = 100;
838   config.link_capacity_kbps = 1000;
839   auto fixture = CreateTestFixture(
840       "pc_foreman_cif_1000kbps_100ms_32pkts_queue",
841       *network_emulation_manager->time_controller(),
842       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
843       [](PeerConfigurer* alice) {
844         VideoConfig video(352, 288, 30);
845         video.stream_label = "alice-video";
846         auto frame_generator = CreateFromYuvFileFrameGenerator(
847             video, ClipNameToClipPath("foreman_cif"));
848         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
849       },
850       [](PeerConfigurer* bob) {});
851   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
852 }
853 
854 // TODO(sprang): Remove this if we have the similar ModerateLimits below?
TEST(PCFullStackTest,Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue)855 TEST(PCFullStackTest, Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue) {
856   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
857       CreateNetworkEmulationManager();
858   BuiltInNetworkBehaviorConfig config;
859   config.queue_length_packets = 32;
860   config.queue_delay_ms = 100;
861   config.link_capacity_kbps = 2000;
862   auto fixture = CreateTestFixture(
863       "pc_conference_motion_hd_2000kbps_100ms_32pkts_queue",
864       *network_emulation_manager->time_controller(),
865       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
866       [](PeerConfigurer* alice) {
867         VideoConfig video(1280, 720, 50);
868         video.stream_label = "alice-video";
869         auto frame_generator = CreateFromYuvFileFrameGenerator(
870             video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
871         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
872       },
873       [](PeerConfigurer* bob) {});
874   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
875 }
876 
877 /*
878 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
879 TEST(PCGenericDescriptorTest, ConferenceMotionHd2TLModerateLimits) {
880   auto fixture = CreateVideoQualityTestFixture();
881   ParamsWithLogging conf_motion_hd;
882   conf_motion_hd.call.send_side_bwe = true;
883   conf_motion_hd.video[0] = {
884       true,    1280,
885       720,     50,
886       30000,   3000000,
887       3000000, false,
888       "VP8",   2,
889       -1,      0,
890       false,   false,
891       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
892   conf_motion_hd.analyzer = {
893       "conference_motion_hd_2tl_moderate_limits_generic_descriptor", 0.0, 0.0,
894       kTestDurationSec};
895   conf_motion_hd.config->queue_length_packets = 50;
896   conf_motion_hd.config->loss_percent = 3;
897   conf_motion_hd.config->queue_delay_ms = 100;
898   conf_motion_hd.config->link_capacity_kbps = 2000;
899   conf_motion_hd.call.generic_descriptor = GenericDescriptorEnabled();
900   fixture->RunWithAnalyzer(conf_motion_hd);
901 }
902 
903 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
904 TEST(PCFullStackTest, ConferenceMotionHd3TLModerateLimits) {
905   auto fixture = CreateVideoQualityTestFixture();
906   ParamsWithLogging conf_motion_hd;
907   conf_motion_hd.call.send_side_bwe = true;
908   conf_motion_hd.video[0] = {
909       true,    1280,
910       720,     50,
911       30000,   3000000,
912       3000000, false,
913       "VP8",   3,
914       -1,      0,
915       false,   false,
916       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
917   conf_motion_hd.analyzer = {"conference_motion_hd_3tl_moderate_limits", 0.0,
918                              0.0, kTestDurationSec};
919   conf_motion_hd.config->queue_length_packets = 50;
920   conf_motion_hd.config->loss_percent = 3;
921   conf_motion_hd.config->queue_delay_ms = 100;
922   conf_motion_hd.config->link_capacity_kbps = 2000;
923   fixture->RunWithAnalyzer(conf_motion_hd);
924 }
925 
926 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
927 TEST(PCFullStackTest, ConferenceMotionHd4TLModerateLimits) {
928   auto fixture = CreateVideoQualityTestFixture();
929   ParamsWithLogging conf_motion_hd;
930   conf_motion_hd.call.send_side_bwe = true;
931   conf_motion_hd.video[0] = {
932       true,    1280,
933       720,     50,
934       30000,   3000000,
935       3000000, false,
936       "VP8",   4,
937       -1,      0,
938       false,   false,
939       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
940   conf_motion_hd.analyzer = {"conference_motion_hd_4tl_moderate_limits", 0.0,
941                              0.0, kTestDurationSec};
942   conf_motion_hd.config->queue_length_packets = 50;
943   conf_motion_hd.config->loss_percent = 3;
944   conf_motion_hd.config->queue_delay_ms = 100;
945   conf_motion_hd.config->link_capacity_kbps = 2000;
946   fixture->RunWithAnalyzer(conf_motion_hd);
947 }
948 
949 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
950 TEST(PCFullStackTest, ConferenceMotionHd3TLModerateLimitsAltTLPattern) {
951   test::ScopedFieldTrials field_trial(
952       AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"));
953   auto fixture = CreateVideoQualityTestFixture();
954   ParamsWithLogging conf_motion_hd;
955   conf_motion_hd.call.send_side_bwe = true;
956   conf_motion_hd.video[0] = {
957       true,    1280,
958       720,     50,
959       30000,   3000000,
960       3000000, false,
961       "VP8",   3,
962       -1,      0,
963       false,   false,
964       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
965   conf_motion_hd.analyzer = {"conference_motion_hd_3tl_alt_moderate_limits",
966                              0.0, 0.0, kTestDurationSec};
967   conf_motion_hd.config->queue_length_packets = 50;
968   conf_motion_hd.config->loss_percent = 3;
969   conf_motion_hd.config->queue_delay_ms = 100;
970   conf_motion_hd.config->link_capacity_kbps = 2000;
971   fixture->RunWithAnalyzer(conf_motion_hd);
972 }
973 
974 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
975 TEST(PCFullStackTest,
976      ConferenceMotionHd3TLModerateLimitsAltTLPatternAndBaseHeavyTLAllocation) {
977   auto fixture = CreateVideoQualityTestFixture();
978   test::ScopedFieldTrials field_trial(
979       AppendFieldTrials("WebRTC-UseShortVP8TL3Pattern/Enabled/"
980                         "WebRTC-UseBaseHeavyVP8TL3RateAllocation/Enabled/"));
981   ParamsWithLogging conf_motion_hd;
982   conf_motion_hd.call.send_side_bwe = true;
983   conf_motion_hd.video[0] = {
984       true,    1280,
985       720,     50,
986       30000,   3000000,
987       3000000, false,
988       "VP8",   3,
989       -1,      0,
990       false,   false,
991       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
992   conf_motion_hd.analyzer = {
993       "conference_motion_hd_3tl_alt_heavy_moderate_limits", 0.0, 0.0,
994       kTestDurationSec};
995   conf_motion_hd.config->queue_length_packets = 50;
996   conf_motion_hd.config->loss_percent = 3;
997   conf_motion_hd.config->queue_delay_ms = 100;
998   conf_motion_hd.config->link_capacity_kbps = 2000;
999   fixture->RunWithAnalyzer(conf_motion_hd);
1000 }
1001 */
1002 
1003 #if defined(RTC_ENABLE_VP9)
TEST_P(ParameterizedPCFullStackTest,Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue_Vp9)1004 TEST_P(ParameterizedPCFullStackTest,
1005        Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue_Vp9) {
1006   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1007       CreateNetworkEmulationManager();
1008   BuiltInNetworkBehaviorConfig config;
1009   config.queue_length_packets = 32;
1010   config.queue_delay_ms = 100;
1011   config.link_capacity_kbps = 2000;
1012   auto fixture = CreateTestFixture(
1013       "pc_conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9" +
1014           GetParam().test_case_name_postfix,
1015       *network_emulation_manager->time_controller(),
1016       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1017       [](PeerConfigurer* alice) {
1018         VideoConfig video(1280, 720, 50);
1019         video.stream_label = "alice-video";
1020         auto frame_generator = CreateFromYuvFileFrameGenerator(
1021             video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1022         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1023         alice->SetVideoCodecs({VideoCodecConfig(
1024             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1025                 {kVP9FmtpProfileId,
1026                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1027         if (GetParam().use_network_thread_as_worker_thread) {
1028           alice->SetUseNetworkThreadAsWorkerThread();
1029         }
1030       },
1031       [](PeerConfigurer* bob) {
1032         bob->SetVideoCodecs({VideoCodecConfig(
1033             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1034                 {kVP9FmtpProfileId,
1035                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1036         if (GetParam().use_network_thread_as_worker_thread) {
1037           bob->SetUseNetworkThreadAsWorkerThread();
1038         }
1039       });
1040   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1041 }
1042 #endif
1043 
TEST(PCFullStackTest,Pc_Screenshare_Slides_No_Conference_Mode)1044 TEST(PCFullStackTest, Pc_Screenshare_Slides_No_Conference_Mode) {
1045   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1046       CreateNetworkEmulationManager();
1047   auto fixture = CreateTestFixture(
1048       "pc_screenshare_slides_no_conference_mode",
1049       *network_emulation_manager->time_controller(),
1050       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1051           BuiltInNetworkBehaviorConfig()),
1052       [](PeerConfigurer* alice) {
1053         VideoConfig video(1850, 1110, 5);
1054         video.stream_label = "alice-video";
1055         video.content_hint = VideoTrackInterface::ContentHint::kText;
1056         auto frame_generator = CreateScreenShareFrameGenerator(
1057             video, ScreenShareConfig(TimeDelta::Seconds(10)));
1058         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1059       },
1060       [](PeerConfigurer* bob) {});
1061   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1062 }
1063 
TEST(PCFullStackTest,Pc_Screenshare_Slides)1064 TEST(PCFullStackTest, Pc_Screenshare_Slides) {
1065   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1066       CreateNetworkEmulationManager();
1067   auto fixture = CreateTestFixture(
1068       "pc_screenshare_slides", *network_emulation_manager->time_controller(),
1069       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1070           BuiltInNetworkBehaviorConfig()),
1071       [](PeerConfigurer* alice) {
1072         VideoConfig video(1850, 1110, 5);
1073         video.stream_label = "alice-video";
1074         video.content_hint = VideoTrackInterface::ContentHint::kText;
1075         auto frame_generator = CreateScreenShareFrameGenerator(
1076             video, ScreenShareConfig(TimeDelta::Seconds(10)));
1077         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1078       },
1079       [](PeerConfigurer* bob) {});
1080   RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
1081   run_params.use_conference_mode = true;
1082   fixture->Run(std::move(run_params));
1083 }
1084 
1085 // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
1086 #if !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
TEST(PCFullStackTest,Pc_Screenshare_Slides_Simulcast_No_Conference_Mode)1087 TEST(PCFullStackTest, Pc_Screenshare_Slides_Simulcast_No_Conference_Mode) {
1088   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1089       CreateNetworkEmulationManager();
1090   auto fixture = CreateTestFixture(
1091       "pc_screenshare_slides_simulcast_no_conference_mode",
1092       *network_emulation_manager->time_controller(),
1093       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1094           BuiltInNetworkBehaviorConfig()),
1095       [](PeerConfigurer* alice) {
1096         VideoConfig video(1850, 1110, 30);
1097         video.simulcast_config = VideoSimulcastConfig(2);
1098         video.emulated_sfu_config = EmulatedSFUConfig(1);
1099         video.temporal_layers_count = 2;
1100         video.stream_label = "alice-video";
1101         video.content_hint = VideoTrackInterface::ContentHint::kText;
1102         auto frame_generator = CreateScreenShareFrameGenerator(
1103             video, ScreenShareConfig(TimeDelta::Seconds(10)));
1104         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1105       },
1106       [](PeerConfigurer* bob) {});
1107   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1108 }
1109 
TEST_P(ParameterizedPCFullStackTest,Pc_Screenshare_Slides_Simulcast)1110 TEST_P(ParameterizedPCFullStackTest, Pc_Screenshare_Slides_Simulcast) {
1111   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1112       CreateNetworkEmulationManager();
1113   auto fixture = CreateTestFixture(
1114       "pc_screenshare_slides_simulcast" + GetParam().test_case_name_postfix,
1115       *network_emulation_manager->time_controller(),
1116       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1117           BuiltInNetworkBehaviorConfig()),
1118       [](PeerConfigurer* alice) {
1119         VideoConfig video(1850, 1110, 30);
1120         video.simulcast_config = VideoSimulcastConfig(2);
1121         video.emulated_sfu_config = EmulatedSFUConfig(1);
1122         video.temporal_layers_count = 2;
1123         video.stream_label = "alice-video";
1124         video.content_hint = VideoTrackInterface::ContentHint::kText;
1125         auto frame_generator = CreateScreenShareFrameGenerator(
1126             video, ScreenShareConfig(TimeDelta::Seconds(10)));
1127         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1128         if (GetParam().use_network_thread_as_worker_thread) {
1129           alice->SetUseNetworkThreadAsWorkerThread();
1130         }
1131       },
1132       [](PeerConfigurer* bob) {
1133         if (GetParam().use_network_thread_as_worker_thread) {
1134           bob->SetUseNetworkThreadAsWorkerThread();
1135         }
1136       });
1137   RunParams run_params(TimeDelta::Seconds(kTestDurationSec));
1138   run_params.use_conference_mode = true;
1139   fixture->Run(std::move(run_params));
1140 }
1141 #endif  // !defined(WEBRTC_MAC) && !defined(WEBRTC_WIN)
1142 
1143 /*
1144 #if !defined(WEBRTC_MAC)
1145 // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on Win/Mac.
1146 #if !defined(WEBRTC_WIN)
1147 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1148 TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Simulcast_low) {
1149   auto fixture = CreateVideoQualityTestFixture();
1150   ParamsWithLogging screenshare;
1151   screenshare.call.send_side_bwe = true;
1152   screenshare.screenshare[0] = {true, false, 10};
1153   screenshare.video[0] = {true,    1850,  1110,  30, 800000, 2500000,
1154                           2500000, false, "VP8", 2,  1,      400000,
1155                           false,   false, false, ""};
1156   screenshare.analyzer = {"screenshare_slides_simulcast_low", 0.0, 0.0,
1157                           kTestDurationSec};
1158   VideoQualityTest::Params screenshare_params_high;
1159   screenshare_params_high.video[0] = {
1160       true,  1850, 1110, 60,     600000, 1250000, 1250000, false,
1161       "VP8", 2,    0,    400000, false,  false,   false,   ""};
1162   VideoQualityTest::Params screenshare_params_low;
1163   screenshare_params_low.video[0] = {true,    1850,  1110,  5, 30000, 200000,
1164                                      1000000, false, "VP8", 2, 0,     400000,
1165                                      false,   false, false, ""};
1166 
1167   std::vector<VideoStream> streams = {
1168       VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1169       VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1170   screenshare.ss[0] = {
1171       streams, 0, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1172       false};
1173   fixture->RunWithAnalyzer(screenshare);
1174 }
1175 
1176 #endif  // !defined(WEBRTC_WIN)
1177 #endif  // !defined(WEBRTC_MAC)
1178 
1179 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1180 TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_Scroll) {
1181   auto fixture = CreateVideoQualityTestFixture();
1182   ParamsWithLogging config;
1183   config.call.send_side_bwe = true;
1184   config.video[0] = {true,    1850,  1110 / 2, 5, 50000, 200000,
1185                      1000000, false, "VP8",    2, 1,     400000,
1186                      false,   false, false,    ""};
1187   config.screenshare[0] = {true, false, 10, 2};
1188   config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0,
1189                      kTestDurationSec};
1190   fixture->RunWithAnalyzer(config);
1191 }
1192 
1193 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1194 TEST(PCGenericDescriptorTest, Screenshare_Slides_Lossy_Net_Generic_Descriptor) {
1195   auto fixture = CreateVideoQualityTestFixture();
1196   ParamsWithLogging screenshare;
1197   screenshare.call.send_side_bwe = true;
1198   screenshare.video[0] = {true,    1850,  1110,  5, 50000, 200000,
1199                           1000000, false, "VP8", 2, 1,     400000,
1200                           false,   false, false, ""};
1201   screenshare.screenshare[0] = {true, false, 10};
1202   screenshare.analyzer = {"screenshare_slides_lossy_net_generic_descriptor",
1203                           0.0, 0.0, kTestDurationSec};
1204   screenshare.config->loss_percent = 5;
1205   screenshare.config->queue_delay_ms = 200;
1206   screenshare.config->link_capacity_kbps = 500;
1207   screenshare.call.generic_descriptor = true;
1208   fixture->RunWithAnalyzer(screenshare);
1209 }
1210 
1211 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1212 TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) {
1213   auto fixture = CreateVideoQualityTestFixture();
1214   ParamsWithLogging screenshare;
1215   screenshare.call.send_side_bwe = true;
1216   screenshare.video[0] = {true,    1850,  1110,  5, 50000, 200000,
1217                           1000000, false, "VP8", 2, 1,     400000,
1218                           false,   false, false, ""};
1219   screenshare.screenshare[0] = {true, false, 10};
1220   screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0,
1221                           kTestDurationSec};
1222   screenshare.config->loss_percent = 10;
1223   screenshare.config->queue_delay_ms = 200;
1224   screenshare.config->link_capacity_kbps = 500;
1225   fixture->RunWithAnalyzer(screenshare);
1226 }
1227 
1228 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1229 TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue) {
1230   auto fixture = CreateVideoQualityTestFixture();
1231   ParamsWithLogging screenshare;
1232   screenshare.call.send_side_bwe = true;
1233   screenshare.video[0] = {true,    1850,  1110,  5, 50000, 200000,
1234                           1000000, false, "VP8", 2, 1,     400000,
1235                           false,   false, false, ""};
1236   screenshare.screenshare[0] = {true, false, 10};
1237   screenshare.analyzer = {"screenshare_slides_lossy_limited", 0.0, 0.0,
1238                           kTestDurationSec};
1239   screenshare.config->loss_percent = 5;
1240   screenshare.config->link_capacity_kbps = 200;
1241   screenshare.config->queue_length_packets = 30;
1242 
1243   fixture->RunWithAnalyzer(screenshare);
1244 }
1245 
1246 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1247 TEST(PCFullStackTest, ScreenshareSlidesVP8_2TL_ModeratelyRestricted) {
1248   auto fixture = CreateVideoQualityTestFixture();
1249   ParamsWithLogging screenshare;
1250   screenshare.call.send_side_bwe = true;
1251   screenshare.video[0] = {true,    1850,  1110,  5, 50000, 200000,
1252                           1000000, false, "VP8", 2, 1,     400000,
1253                           false,   false, false, ""};
1254   screenshare.screenshare[0] = {true, false, 10};
1255   screenshare.analyzer = {"screenshare_slides_moderately_restricted", 0.0, 0.0,
1256                           kTestDurationSec};
1257   screenshare.config->loss_percent = 1;
1258   screenshare.config->link_capacity_kbps = 1200;
1259   screenshare.config->queue_length_packets = 30;
1260 
1261   fixture->RunWithAnalyzer(screenshare);
1262 }
1263 
1264 namespace {
1265 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1266 // Since ParamsWithLogging::Video is not trivially destructible, we can't
1267 // store these structs as const globals.
1268 ParamsWithLogging::Video SvcVp9Video() {
1269   return ParamsWithLogging::Video{
1270       true,    1280,
1271       720,     30,
1272       800000,  2500000,
1273       2500000, false,
1274       "VP9",   3,
1275       2,       400000,
1276       false,   false,
1277       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1278 }
1279 
1280 ParamsWithLogging::Video SimulcastVp8VideoHigh() {
1281   return ParamsWithLogging::Video{
1282       true,    1280,
1283       720,     30,
1284       800000,  2500000,
1285       2500000, false,
1286       "VP8",   3,
1287       2,       400000,
1288       false,   false,
1289       false,   ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1290 }
1291 
1292 ParamsWithLogging::Video SimulcastVp8VideoMedium() {
1293   return ParamsWithLogging::Video{
1294       true,   640,
1295       360,    30,
1296       150000, 500000,
1297       700000, false,
1298       "VP8",  3,
1299       2,      400000,
1300       false,  false,
1301       false,  ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1302 }
1303 
1304 ParamsWithLogging::Video SimulcastVp8VideoLow() {
1305   return ParamsWithLogging::Video{
1306       true,   320,
1307       180,    30,
1308       30000,  150000,
1309       200000, false,
1310       "VP8",  3,
1311       2,      400000,
1312       false,  false,
1313       false,  ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1314 }
1315 }  // namespace
1316 */
1317 
1318 #if defined(RTC_ENABLE_VP9)
1319 
TEST(PCFullStackTest,Pc_Screenshare_Slides_Vp9_3sl_High_Fps)1320 TEST(PCFullStackTest, Pc_Screenshare_Slides_Vp9_3sl_High_Fps) {
1321   webrtc::test::ScopedFieldTrials override_trials(
1322       AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1323                         "Enabled,inter_layer_pred_mode:on/"));
1324   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1325       CreateNetworkEmulationManager();
1326   auto fixture = CreateTestFixture(
1327       "pc_screenshare_slides_vp9_3sl_high_fps",
1328       *network_emulation_manager->time_controller(),
1329       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1330           BuiltInNetworkBehaviorConfig()),
1331       [](PeerConfigurer* alice) {
1332         VideoConfig video(1850, 1110, 30);
1333         video.stream_label = "alice-video";
1334         video.simulcast_config = VideoSimulcastConfig(3);
1335         video.emulated_sfu_config = EmulatedSFUConfig(2);
1336         video.content_hint = VideoTrackInterface::ContentHint::kText;
1337         auto frame_generator = CreateScreenShareFrameGenerator(
1338             video, ScreenShareConfig(TimeDelta::Seconds(10)));
1339         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1340         alice->SetVideoCodecs({VideoCodecConfig(
1341             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1342                 {kVP9FmtpProfileId,
1343                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1344       },
1345       [](PeerConfigurer* bob) {
1346         bob->SetVideoCodecs({VideoCodecConfig(
1347             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1348                 {kVP9FmtpProfileId,
1349                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1350       });
1351   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1352 }
1353 
TEST(PCFullStackTest,Pc_Vp9svc_3sl_High)1354 TEST(PCFullStackTest, Pc_Vp9svc_3sl_High) {
1355   webrtc::test::ScopedFieldTrials override_trials(
1356       AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1357                         "Enabled,inter_layer_pred_mode:on/"));
1358   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1359       CreateNetworkEmulationManager();
1360   auto fixture = CreateTestFixture(
1361       "pc_vp9svc_3sl_high", *network_emulation_manager->time_controller(),
1362       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1363           BuiltInNetworkBehaviorConfig()),
1364       [](PeerConfigurer* alice) {
1365         VideoConfig video(1280, 720, 30);
1366         video.stream_label = "alice-video";
1367         video.simulcast_config = VideoSimulcastConfig(3);
1368         video.emulated_sfu_config = EmulatedSFUConfig(2);
1369         video.temporal_layers_count = 3;
1370         auto frame_generator = CreateFromYuvFileFrameGenerator(
1371             video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1372         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1373         alice->SetVideoCodecs({VideoCodecConfig(
1374             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1375                 {kVP9FmtpProfileId,
1376                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1377       },
1378       [](PeerConfigurer* bob) {
1379         bob->SetVideoCodecs({VideoCodecConfig(
1380             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1381                 {kVP9FmtpProfileId,
1382                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1383       });
1384   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1385 }
1386 
TEST(PCFullStackTest,Pc_Vp9svc_3sl_Low)1387 TEST(PCFullStackTest, Pc_Vp9svc_3sl_Low) {
1388   webrtc::test::ScopedFieldTrials override_trials(
1389       AppendFieldTrials("WebRTC-Vp9InterLayerPred/"
1390                         "Enabled,inter_layer_pred_mode:on/"));
1391   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1392       CreateNetworkEmulationManager();
1393   auto fixture = CreateTestFixture(
1394       "pc_vp9svc_3sl_low", *network_emulation_manager->time_controller(),
1395       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(
1396           BuiltInNetworkBehaviorConfig()),
1397       [](PeerConfigurer* alice) {
1398         VideoConfig video(1280, 720, 30);
1399         video.stream_label = "alice-video";
1400         video.simulcast_config = VideoSimulcastConfig(3);
1401         video.emulated_sfu_config = EmulatedSFUConfig(0);
1402         video.temporal_layers_count = 3;
1403         auto frame_generator = CreateFromYuvFileFrameGenerator(
1404             video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1405         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1406         alice->SetVideoCodecs({VideoCodecConfig(
1407             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1408                 {kVP9FmtpProfileId,
1409                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1410       },
1411       [](PeerConfigurer* bob) {
1412         bob->SetVideoCodecs({VideoCodecConfig(
1413             /*name=*/cricket::kVp9CodecName, /*required_params=*/{
1414                 {kVP9FmtpProfileId,
1415                  VP9ProfileToString(VP9Profile::kProfile0)}})});
1416       });
1417   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1418 }
1419 
1420 #endif  // defined(RTC_ENABLE_VP9)
1421 
1422 /*
1423 // bugs.webrtc.org/9506
1424 #if !defined(WEBRTC_MAC)
1425 
1426 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1427 TEST(PCFullStackTest, VP9KSVC_3SL_High) {
1428   webrtc::test::ScopedFieldTrials override_trials(
1429       AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1430   auto fixture = CreateVideoQualityTestFixture();
1431   ParamsWithLogging simulcast;
1432   simulcast.call.send_side_bwe = true;
1433   simulcast.video[0] = SvcVp9Video();
1434   simulcast.analyzer = {"vp9ksvc_3sl_high", 0.0, 0.0, kTestDurationSec};
1435   simulcast.ss[0] = {
1436       std::vector<VideoStream>(),  0,    3, 2, InterLayerPredMode::kOnKeyPic,
1437       std::vector<SpatialLayer>(), false};
1438   fixture->RunWithAnalyzer(simulcast);
1439 }
1440 
1441 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1442 TEST(PCFullStackTest, VP9KSVC_3SL_Medium) {
1443   webrtc::test::ScopedFieldTrials override_trials(
1444       AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1445   auto fixture = CreateVideoQualityTestFixture();
1446   ParamsWithLogging simulcast;
1447   simulcast.call.send_side_bwe = true;
1448   simulcast.video[0] = SvcVp9Video();
1449   simulcast.analyzer = {"vp9ksvc_3sl_medium", 0.0, 0.0, kTestDurationSec};
1450   simulcast.ss[0] = {
1451       std::vector<VideoStream>(),  0,    3, 1, InterLayerPredMode::kOnKeyPic,
1452       std::vector<SpatialLayer>(), false};
1453   fixture->RunWithAnalyzer(simulcast);
1454 }
1455 
1456 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1457 TEST(PCFullStackTest, VP9KSVC_3SL_Low) {
1458   webrtc::test::ScopedFieldTrials override_trials(
1459       AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1460   auto fixture = CreateVideoQualityTestFixture();
1461   ParamsWithLogging simulcast;
1462   simulcast.call.send_side_bwe = true;
1463   simulcast.video[0] = SvcVp9Video();
1464   simulcast.analyzer = {"vp9ksvc_3sl_low", 0.0, 0.0, kTestDurationSec};
1465   simulcast.ss[0] = {
1466       std::vector<VideoStream>(),  0,    3, 0, InterLayerPredMode::kOnKeyPic,
1467       std::vector<SpatialLayer>(), false};
1468   fixture->RunWithAnalyzer(simulcast);
1469 }
1470 
1471 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1472 TEST(PCFullStackTest, VP9KSVC_3SL_Medium_Network_Restricted) {
1473   webrtc::test::ScopedFieldTrials override_trials(
1474       AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1475   auto fixture = CreateVideoQualityTestFixture();
1476   ParamsWithLogging simulcast;
1477   simulcast.call.send_side_bwe = true;
1478   simulcast.video[0] = SvcVp9Video();
1479   simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted", 0.0, 0.0,
1480                         kTestDurationSec};
1481   simulcast.ss[0] = {
1482       std::vector<VideoStream>(),  0,    3, -1, InterLayerPredMode::kOnKeyPic,
1483       std::vector<SpatialLayer>(), false};
1484   simulcast.config->link_capacity_kbps = 1000;
1485   simulcast.config->queue_delay_ms = 100;
1486   fixture->RunWithAnalyzer(simulcast);
1487 }
1488 
1489 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1490 // TODO(webrtc:9722): Remove when experiment is cleaned up.
1491 TEST(PCFullStackTest, VP9KSVC_3SL_Medium_Network_Restricted_Trusted_Rate) {
1492   webrtc::test::ScopedFieldTrials override_trials(
1493       AppendFieldTrials("WebRTC-Vp9IssueKeyFrameOnLayerDeactivation/Enabled/"));
1494   auto fixture = CreateVideoQualityTestFixture();
1495   ParamsWithLogging simulcast;
1496   simulcast.call.send_side_bwe = true;
1497   simulcast.video[0] = SvcVp9Video();
1498   simulcast.analyzer = {"vp9ksvc_3sl_medium_network_restricted_trusted_rate",
1499                         0.0, 0.0, kTestDurationSec};
1500   simulcast.ss[0] = {
1501       std::vector<VideoStream>(),  0,    3, -1, InterLayerPredMode::kOnKeyPic,
1502       std::vector<SpatialLayer>(), false};
1503   simulcast.config->link_capacity_kbps = 1000;
1504   simulcast.config->queue_delay_ms = 100;
1505   fixture->RunWithAnalyzer(simulcast);
1506 }
1507 #endif  // !defined(WEBRTC_MAC)
1508 
1509 #endif  // defined(RTC_ENABLE_VP9)
1510 */
1511 
1512 // Android bots can't handle FullHD, so disable the test.
1513 // TODO(bugs.webrtc.org/9220): Investigate source of flakiness on Mac.
1514 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
1515 #define MAYBE_Pc_Simulcast_HD_High DISABLED_Pc_Simulcast_HD_High
1516 #else
1517 #define MAYBE_Pc_Simulcast_HD_High Pc_Simulcast_HD_High
1518 #endif
TEST(PCFullStackTest,MAYBE_Pc_Simulcast_HD_High)1519 TEST(PCFullStackTest, MAYBE_Pc_Simulcast_HD_High) {
1520   webrtc::test::ScopedFieldTrials override_trials(AppendFieldTrials(
1521       "WebRTC-ForceSimulatedOveruseIntervalMs/1000-50000-300/"));
1522   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1523       CreateNetworkEmulationManager();
1524   BuiltInNetworkBehaviorConfig config;
1525   config.loss_percent = 0;
1526   config.queue_delay_ms = 100;
1527   auto fixture = CreateTestFixture(
1528       "pc_simulcast_HD_high", *network_emulation_manager->time_controller(),
1529       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1530       [](PeerConfigurer* alice) {
1531         VideoConfig video(1920, 1080, 30);
1532         video.simulcast_config = VideoSimulcastConfig(3);
1533         video.emulated_sfu_config = EmulatedSFUConfig(2);
1534         video.temporal_layers_count = 3;
1535         video.stream_label = "alice-video";
1536         alice->AddVideoConfig(std::move(video));
1537       },
1538       [](PeerConfigurer* bob) {});
1539   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1540 }
1541 
TEST_P(ParameterizedPCFullStackTest,Pc_Simulcast_Vp8_3sl_High)1542 TEST_P(ParameterizedPCFullStackTest, Pc_Simulcast_Vp8_3sl_High) {
1543   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1544       CreateNetworkEmulationManager();
1545   BuiltInNetworkBehaviorConfig config;
1546   config.loss_percent = 0;
1547   config.queue_delay_ms = 100;
1548   auto fixture = CreateTestFixture(
1549       "pc_simulcast_vp8_3sl_high" + GetParam().test_case_name_postfix,
1550       *network_emulation_manager->time_controller(),
1551       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1552       [](PeerConfigurer* alice) {
1553         VideoConfig video(1280, 720, 30);
1554         video.simulcast_config = VideoSimulcastConfig(3);
1555         video.emulated_sfu_config = EmulatedSFUConfig(2);
1556         video.stream_label = "alice-video";
1557         auto frame_generator = CreateFromYuvFileFrameGenerator(
1558             video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1559         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1560         if (GetParam().use_network_thread_as_worker_thread) {
1561           alice->SetUseNetworkThreadAsWorkerThread();
1562         }
1563       },
1564       [](PeerConfigurer* bob) {
1565         if (GetParam().use_network_thread_as_worker_thread) {
1566           bob->SetUseNetworkThreadAsWorkerThread();
1567         }
1568       });
1569   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1570 }
1571 
TEST(PCFullStackTest,Pc_Simulcast_Vp8_3sl_Low)1572 TEST(PCFullStackTest, Pc_Simulcast_Vp8_3sl_Low) {
1573   std::unique_ptr<NetworkEmulationManager> network_emulation_manager =
1574       CreateNetworkEmulationManager();
1575   BuiltInNetworkBehaviorConfig config;
1576   config.loss_percent = 0;
1577   config.queue_delay_ms = 100;
1578   auto fixture = CreateTestFixture(
1579       "pc_simulcast_vp8_3sl_low", *network_emulation_manager->time_controller(),
1580       network_emulation_manager->CreateEndpointPairWithTwoWayRoutes(config),
1581       [](PeerConfigurer* alice) {
1582         VideoConfig video(1280, 720, 30);
1583         video.simulcast_config = VideoSimulcastConfig(3);
1584         video.emulated_sfu_config = EmulatedSFUConfig(0);
1585         video.stream_label = "alice-video";
1586         auto frame_generator = CreateFromYuvFileFrameGenerator(
1587             video, ClipNameToClipPath("ConferenceMotion_1280_720_50"));
1588         alice->AddVideoConfig(std::move(video), std::move(frame_generator));
1589       },
1590       [](PeerConfigurer* bob) {});
1591   fixture->Run(RunParams(TimeDelta::Seconds(kTestDurationSec)));
1592 }
1593 
1594 /*
1595 // This test assumes ideal network conditions with target bandwidth being
1596 // available and exercises WebRTC calls with a high target bitrate(100 Mbps).
1597 // Android32 bots can't handle this high bitrate, so disable test for those.
1598 #if defined(WEBRTC_ANDROID)
1599 #define MAYBE_HighBitrateWithFakeCodec DISABLED_HighBitrateWithFakeCodec
1600 #else
1601 #define MAYBE_HighBitrateWithFakeCodec HighBitrateWithFakeCodec
1602 #endif  // defined(WEBRTC_ANDROID)
1603 // TODO(bugs.webrtc.org/10639) Disabled because target bitrate can't be
1604 configured yet. TEST(PCFullStackTest, MAYBE_HighBitrateWithFakeCodec) { auto
1605 fixture = CreateVideoQualityTestFixture(); const int target_bitrate = 100000000;
1606   ParamsWithLogging generator;
1607   generator.call.send_side_bwe = true;
1608   generator.call.call_bitrate_config.min_bitrate_bps = target_bitrate;
1609   generator.call.call_bitrate_config.start_bitrate_bps = target_bitrate;
1610   generator.call.call_bitrate_config.max_bitrate_bps = target_bitrate;
1611   generator.video[0] = {true,
1612                         360,
1613                         240,
1614                         30,
1615                         target_bitrate / 2,
1616                         target_bitrate,
1617                         target_bitrate * 2,
1618                         false,
1619                         "FakeCodec",
1620                         1,
1621                         0,
1622                         0,
1623                         false,
1624                         false,
1625                         false,
1626                         "Generator"};
1627   generator.analyzer = {"high_bitrate_with_fake_codec", 0.0, 0.0,
1628                         kTestDurationSec};
1629   fixture->RunWithAnalyzer(generator);
1630 }
1631 
1632 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1633 TEST(PCFullStackTest, LargeRoomVP8_5thumb) {
1634   auto fixture = CreateVideoQualityTestFixture();
1635   ParamsWithLogging large_room;
1636   large_room.call.send_side_bwe = true;
1637   large_room.video[0] = SimulcastVp8VideoHigh();
1638   large_room.analyzer = {"largeroom_5thumb", 0.0, 0.0, kTestDurationSec};
1639   large_room.config->loss_percent = 0;
1640   large_room.config->queue_delay_ms = 100;
1641   ParamsWithLogging video_params_high;
1642   video_params_high.video[0] = SimulcastVp8VideoHigh();
1643   ParamsWithLogging video_params_medium;
1644   video_params_medium.video[0] = SimulcastVp8VideoMedium();
1645   ParamsWithLogging video_params_low;
1646   video_params_low.video[0] = SimulcastVp8VideoLow();
1647 
1648   std::vector<VideoStream> streams = {
1649       VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1650       VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1651       VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1652   large_room.call.num_thumbnails = 5;
1653   large_room.ss[0] = {
1654       streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1655       false};
1656   fixture->RunWithAnalyzer(large_room);
1657 }
1658 
1659 #if defined(WEBRTC_ANDROID) || defined(WEBRTC_IOS)
1660 // Fails on mobile devices:
1661 // https://bugs.chromium.org/p/webrtc/issues/detail?id=7301
1662 #define MAYBE_LargeRoomVP8_50thumb DISABLED_LargeRoomVP8_50thumb
1663 #define MAYBE_LargeRoomVP8_15thumb DISABLED_LargeRoomVP8_15thumb
1664 #else
1665 #define MAYBE_LargeRoomVP8_50thumb LargeRoomVP8_50thumb
1666 #define MAYBE_LargeRoomVP8_15thumb LargeRoomVP8_15thumb
1667 #endif
1668 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1669 TEST(PCFullStackTest, MAYBE_LargeRoomVP8_15thumb) {
1670   auto fixture = CreateVideoQualityTestFixture();
1671   ParamsWithLogging large_room;
1672   large_room.call.send_side_bwe = true;
1673   large_room.video[0] = SimulcastVp8VideoHigh();
1674   large_room.analyzer = {"largeroom_15thumb", 0.0, 0.0, kTestDurationSec};
1675   large_room.config->loss_percent = 0;
1676   large_room.config->queue_delay_ms = 100;
1677   ParamsWithLogging video_params_high;
1678   video_params_high.video[0] = SimulcastVp8VideoHigh();
1679   ParamsWithLogging video_params_medium;
1680   video_params_medium.video[0] = SimulcastVp8VideoMedium();
1681   ParamsWithLogging video_params_low;
1682   video_params_low.video[0] = SimulcastVp8VideoLow();
1683 
1684   std::vector<VideoStream> streams = {
1685       VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1686       VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1687       VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1688   large_room.call.num_thumbnails = 15;
1689   large_room.ss[0] = {
1690       streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1691       false};
1692   fixture->RunWithAnalyzer(large_room);
1693 }
1694 
1695 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1696 TEST(PCFullStackTest, MAYBE_LargeRoomVP8_50thumb) {
1697   auto fixture = CreateVideoQualityTestFixture();
1698   ParamsWithLogging large_room;
1699   large_room.call.send_side_bwe = true;
1700   large_room.video[0] = SimulcastVp8VideoHigh();
1701   large_room.analyzer = {"largeroom_50thumb", 0.0, 0.0, kTestDurationSec};
1702   large_room.config->loss_percent = 0;
1703   large_room.config->queue_delay_ms = 100;
1704   ParamsWithLogging video_params_high;
1705   video_params_high.video[0] = SimulcastVp8VideoHigh();
1706   ParamsWithLogging video_params_medium;
1707   video_params_medium.video[0] = SimulcastVp8VideoMedium();
1708   ParamsWithLogging video_params_low;
1709   video_params_low.video[0] = SimulcastVp8VideoLow();
1710 
1711   std::vector<VideoStream> streams = {
1712       VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1713       VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1714       VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1715   large_room.call.num_thumbnails = 50;
1716   large_room.ss[0] = {
1717       streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1718       false};
1719   fixture->RunWithAnalyzer(large_room);
1720 }
1721 */
1722 
1723 /*
1724 class PCDualStreamsTest : public ::testing::TestWithParam<int> {};
1725 
1726 // Disable dual video test on mobile device becuase it's too heavy.
1727 // TODO(bugs.webrtc.org/9840): Investigate why is this test flaky on MAC.
1728 #if !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) && !defined(WEBRTC_MAC)
1729 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1730 TEST_P(PCDualStreamsTest,
1731        ModeratelyRestricted_SlidesVp8_2TL_Simulcast_Video_Simulcast_High) {
1732   const int first_stream = GetParam();
1733   ParamsWithLogging dual_streams;
1734 
1735   // Screenshare Settings.
1736   dual_streams.screenshare[first_stream] = {true, false, 10};
1737   dual_streams.video[first_stream] = {true,    1850,  1110,  5, 800000, 2500000,
1738                                       2500000, false, "VP8", 2, 1,      400000,
1739                                       false,   false, false, ""};
1740 
1741   ParamsWithLogging screenshare_params_high;
1742   screenshare_params_high.video[0] = {
1743       true,  1850, 1110, 60,     600000, 1250000, 1250000, false,
1744       "VP8", 2,    0,    400000, false,  false,   false,   ""};
1745   VideoQualityTest::Params screenshare_params_low;
1746   screenshare_params_low.video[0] = {true,    1850,  1110,  5, 30000, 200000,
1747                                      1000000, false, "VP8", 2, 0,     400000,
1748                                      false,   false, false, ""};
1749   std::vector<VideoStream> screenhsare_streams = {
1750       VideoQualityTest::DefaultVideoStream(screenshare_params_low, 0),
1751       VideoQualityTest::DefaultVideoStream(screenshare_params_high, 0)};
1752 
1753   dual_streams.ss[first_stream] = {
1754       screenhsare_streams,         1,    1, 0, InterLayerPredMode::kOn,
1755       std::vector<SpatialLayer>(), false};
1756 
1757   // Video settings.
1758   dual_streams.video[1 - first_stream] = SimulcastVp8VideoHigh();
1759 
1760   ParamsWithLogging video_params_high;
1761   video_params_high.video[0] = SimulcastVp8VideoHigh();
1762   ParamsWithLogging video_params_medium;
1763   video_params_medium.video[0] = SimulcastVp8VideoMedium();
1764   ParamsWithLogging video_params_low;
1765   video_params_low.video[0] = SimulcastVp8VideoLow();
1766   std::vector<VideoStream> streams = {
1767       VideoQualityTest::DefaultVideoStream(video_params_low, 0),
1768       VideoQualityTest::DefaultVideoStream(video_params_medium, 0),
1769       VideoQualityTest::DefaultVideoStream(video_params_high, 0)};
1770 
1771   dual_streams.ss[1 - first_stream] = {
1772       streams, 2, 1, 0, InterLayerPredMode::kOn, std::vector<SpatialLayer>(),
1773       false};
1774 
1775   // Call settings.
1776   dual_streams.call.send_side_bwe = true;
1777   dual_streams.call.dual_video = true;
1778   std::string test_label = "dualstreams_moderately_restricted_screenshare_" +
1779                            std::to_string(first_stream);
1780   dual_streams.analyzer = {test_label, 0.0, 0.0, kTestDurationSec};
1781   dual_streams.config->loss_percent = 1;
1782   dual_streams.config->link_capacity_kbps = 7500;
1783   dual_streams.config->queue_length_packets = 30;
1784   dual_streams.config->queue_delay_ms = 100;
1785 
1786   auto fixture = CreateVideoQualityTestFixture();
1787   fixture->RunWithAnalyzer(dual_streams);
1788 }
1789 #endif  // !defined(WEBRTC_ANDROID) && !defined(WEBRTC_IOS) &&
1790         // !defined(WEBRTC_MAC)
1791 
1792 // TODO(bugs.webrtc.org/10639) requires simulcast/SVC support in PC framework
1793 TEST_P(PCDualStreamsTest, Conference_Restricted) {
1794   const int first_stream = GetParam();
1795   ParamsWithLogging dual_streams;
1796 
1797   // Screenshare Settings.
1798   dual_streams.screenshare[first_stream] = {true, false, 10};
1799   dual_streams.video[first_stream] = {true,    1850,  1110,  5, 800000, 2500000,
1800                                       2500000, false, "VP8", 3, 2,      400000,
1801                                       false,   false, false, ""};
1802   // Video settings.
1803   dual_streams.video[1 - first_stream] = {
1804       true,   1280,
1805       720,    30,
1806       150000, 500000,
1807       700000, false,
1808       "VP8",  3,
1809       2,      400000,
1810       false,  false,
1811       false,  ClipNameToClipPath("ConferenceMotion_1280_720_50")};
1812 
1813   // Call settings.
1814   dual_streams.call.send_side_bwe = true;
1815   dual_streams.call.dual_video = true;
1816   std::string test_label = "dualstreams_conference_restricted_screenshare_" +
1817                            std::to_string(first_stream);
1818   dual_streams.analyzer = {test_label, 0.0, 0.0, kTestDurationSec};
1819   dual_streams.config->loss_percent = 1;
1820   dual_streams.config->link_capacity_kbps = 5000;
1821   dual_streams.config->queue_length_packets = 30;
1822   dual_streams.config->queue_delay_ms = 100;
1823 
1824   auto fixture = CreateVideoQualityTestFixture();
1825   fixture->RunWithAnalyzer(dual_streams);
1826 }
1827 
1828 INSTANTIATE_TEST_SUITE_P(PCFullStackTest,
1829                          PCDualStreamsTest,
1830                          ::testing::Values(0, 1));
1831 */
1832 
1833 }  // namespace webrtc
1834