Enable WebRTC-UseStandardBytesStats in E2E tests by default.

Before this CL PeerConnectionE2EQualityTestSmokeTest was actually
overwriting this field trial:
[ RUN      ] PeerConnectionE2EQualityTestSmokeTest.Smoke
(field_trial.cc:140): Setting field trial string:WebRTC-UseStandardBytesStats/Enabled/
(field_trial.cc:140): Setting field trial string:
(network_emulation.cc:480): Created emulated endpoint 192.168.0.0 (); id=1
(network_emulation.cc:480): Created emulated endpoint 192.168.0.1 (); id=2
(field_trial.cc:140): Setting field trial string:WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/

After this CL it is instead used:
[ RUN      ] PeerConnectionE2EQualityTestSmokeTest.Smoke
(network_emulation.cc:480): Created emulated endpoint 192.168.0.0 (); id=1
(network_emulation.cc:480): Created emulated endpoint 192.168.0.1 (); id=2
(field_trial.cc:140): Setting field trial string:WebRTC-UseStandardBytesStats/Enabled/WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/

This CL also removes the non effective field trial override in
test/pc/e2e/peer_connection_e2e_smoke_test.cc which was unset as soon
as the variable was going out of scope.

Bug: b/186198412
Change-Id: I1698407e2c490a80c1f835cd591624446cf993fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/229023
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34779}
This commit is contained in:
Mirko Bonadei 2021-08-17 10:22:09 +02:00 committed by WebRTC LUCI CQ
parent 14ef6338b0
commit 5bf0bb3ed2
2 changed files with 14 additions and 8 deletions

View File

@ -56,9 +56,6 @@ class PeerConnectionE2EQualityTestSmokeTest : public ::testing::Test {
testing::UnitTest::GetInstance()->current_test_info()->name(),
*network_emulation_->time_controller(),
/*audio_quality_analyzer=*/nullptr, std::move(video_quality_analyzer));
test::ScopedFieldTrials field_trials(
std::string(field_trial::GetFieldTrialString()) +
"WebRTC-UseStandardBytesStats/Enabled/");
}
std::pair<EmulatedNetworkManagerInterface*, EmulatedNetworkManagerInterface*>

View File

@ -27,6 +27,7 @@
#include "pc/test/mock_peer_connection_observers.h"
#include "rtc_base/gunit.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/strings/string_builder.h"
#include "system_wrappers/include/cpu_info.h"
#include "system_wrappers/include/field_trial.h"
#include "test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h"
@ -63,6 +64,8 @@ constexpr TimeDelta kQuickTestModeRunDuration = TimeDelta::Millis(100);
// Field trials to enable Flex FEC advertising and receiving.
constexpr char kFlexFecEnabledFieldTrials[] =
"WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/";
constexpr char kUseStandardsBytesStats[] =
"WebRTC-UseStandardBytesStats/Enabled/";
class FixturePeerConnectionObserver : public MockPeerConnectionObserver {
public:
@ -386,13 +389,19 @@ void PeerConnectionE2EQualityTest::Run(RunParams run_params) {
void PeerConnectionE2EQualityTest::SetupRequiredFieldTrials(
const RunParams& run_params) {
std::string field_trials = "";
std::vector<absl::string_view> default_field_trials = {
kUseStandardsBytesStats};
if (run_params.use_flex_fec) {
field_trials += kFlexFecEnabledFieldTrials;
default_field_trials.push_back(kFlexFecEnabledFieldTrials);
}
if (!field_trials.empty()) {
override_field_trials_ = std::make_unique<test::ScopedFieldTrials>(
field_trial::GetFieldTrialString() + field_trials);
if (!default_field_trials.empty()) {
rtc::StringBuilder sb;
sb << field_trial::GetFieldTrialString();
for (const absl::string_view& field_trial : default_field_trials) {
sb << field_trial;
}
override_field_trials_ =
std::make_unique<test::ScopedFieldTrials>(sb.Release());
}
}