#include "chrome/browser/media/webrtc/webrtc_browsertest_perf.h"
#include <stddef.h>
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "testing/perf/perf_result_reporter.h"
#include "testing/perf/perf_test.h"
namespace {
std::string Statistic(const std::string& statistic, const std::string& bucket) { … }
void MaybePrintResultsForAudioReceive(const std::string& ssrc,
const base::Value::Dict& pc_dict,
const std::string& modifier) { … }
void MaybePrintResultsForAudioSend(const std::string& ssrc,
const base::Value::Dict& pc_dict,
const std::string& modifier) { … }
void MaybePrintResultsForVideoSend(const std::string& ssrc,
const base::Value::Dict& pc_dict,
const std::string& modifier) { … }
void MaybePrintResultsForVideoReceive(const std::string& ssrc,
const base::Value::Dict& pc_dict,
const std::string& modifier) { … }
std::string ExtractSsrcIdentifier(const std::string& key) { … }
std::set<std::string> FindAllSsrcIdentifiers(
const base::Value::Dict& stats_dict) { … }
}
namespace test {
void PrintBweForVideoMetrics(const base::Value::Dict& pc_dict,
const std::string& modifier,
const std::string& video_codec) { … }
void PrintMetricsForAllStreams(const base::Value::Dict& pc_dict,
const std::string& modifier,
const std::string& video_codec) { … }
void PrintMetricsForSendStreams(const base::Value::Dict& pc_dict,
const std::string& modifier,
const std::string& video_codec) { … }
void PrintMetricsForRecvStreams(const base::Value::Dict& pc_dict,
const std::string& modifier,
const std::string& video_codec) { … }
constexpr char kMetricPrefixVideoQualityTest[] = …;
constexpr char kMetricUniqueFramesCount[] = …;
constexpr char kMetricPsnrUnitless[] = …;
constexpr char kMetricSsimUnitless[] = …;
constexpr char kMetricMaxRepeatedCount[] = …;
constexpr char kMetricMaxSkippedCount[] = …;
constexpr char kMetricTotalSkippedCount[] = …;
constexpr char kMetricDecodeErrorsReferenceCount[] = …;
constexpr char kMetricDecodeErrorsTestCount[] = …;
bool ParseDoubleFromOutput(const std::string& line,
const char* expected_label,
double* value) { … }
bool ParseListFromOutput(const std::string& line,
const char* expected_label,
std::string* value) { … }
bool WriteCompareVideosOutputAsHistogram(const std::string& test_label,
const std::string& output) { … }
}