#include "chrome/browser/predictors/loading_stats_collector.h"
#include <vector>
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "chrome/browser/predictors/loading_test_util.h"
#include "chrome/browser/predictors/preconnect_manager.h"
#include "chrome/test/base/testing_profile.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "net/base/network_isolation_key.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
DoAll;
Return;
SetArgPointee;
StrictMock;
namespace predictors {
namespace {
const char kInitialUrl[] = …;
const char kRedirectedUrl[] = …;
const char kRedirectedUrl2[] = …;
}
RedirectStatus;
class LoadingStatsCollectorTest : public testing::Test { … };
LoadingStatsCollectorTest::LoadingStatsCollectorTest() = default;
LoadingStatsCollectorTest::~LoadingStatsCollectorTest() = default;
void LoadingStatsCollectorTest::SetUp() { … }
void LoadingStatsCollectorTest::TestRedirectStatusHistogram(
const std::string& initial_url,
const std::string& prediction_url,
const std::string& navigation_url,
RedirectStatus expected_status) { … }
TEST_F(LoadingStatsCollectorTest, TestPreconnectPrecisionRecallMetrics) { … }
TEST_F(LoadingStatsCollectorTest,
TestPrecisionRecallMetricsWithOptimizationGuide) { … }
TEST_F(LoadingStatsCollectorTest,
TestOptimizationGuideCorrectPredictionsPostLoad) { … }
TEST_F(LoadingStatsCollectorTest, TestNoMetricsRecordedBeforeLoadComplete) { … }
TEST_F(LoadingStatsCollectorTest, TestRedirectStatusNoRedirect) { … }
TEST_F(LoadingStatsCollectorTest, TestRedirectStatusNoRedirectButPredicted) { … }
TEST_F(LoadingStatsCollectorTest, TestRedirectStatusRedirectNotPredicted) { … }
TEST_F(LoadingStatsCollectorTest, TestRedirectStatusRedirectWrongPredicted) { … }
TEST_F(LoadingStatsCollectorTest,
TestRedirectStatusRedirectCorrectlyPredicted) { … }
TEST_F(LoadingStatsCollectorTest, TestPreconnectHistograms) { … }
TEST_F(LoadingStatsCollectorTest, TestPreconnectHistogramsEmpty) { … }
TEST_F(LoadingStatsCollectorTest, TestPreconnectHistogramsPreresolvesOnly) { … }
}