chromium/chrome/browser/predictors/loading_stats_collector_unittest.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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) {}

// Tests that preconnect histograms won't be recorded if preconnect stats are
// empty.
TEST_F(LoadingStatsCollectorTest, TestPreconnectHistogramsEmpty) {}

// Tests that the preconnect won't divide by zero if preconnect stats contain
// preresolve attempts only.
TEST_F(LoadingStatsCollectorTest, TestPreconnectHistogramsPreresolvesOnly) {}

}  // namespace predictors