#include "content/browser/preloading/preloading_data_impl.h"
#include <algorithm>
#include "base/strings/strcat.h"
#include "base/test/metrics/histogram_tester.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/browser/preloading/preloading.h"
#include "content/browser/preloading/preloading_confidence.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/test/mock_navigation_handle.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_browser_context.h"
#include "content/public/test/test_renderer_host.h"
#include "content/test/test_web_contents.h"
#include "services/metrics/public/cpp/metrics_utils.h"
#include "services/metrics/public/cpp/ukm_builders.h"
namespace content {
class PreloadingDataImplTest : public RenderViewHostTestHarness { … };
TEST_F(PreloadingDataImplTest, PredictorPrecisionAndRecall) { … }
TEST_F(PreloadingDataImplTest, PageLoadWithoutAttemptIsFalseNegative) { … }
TEST_F(PreloadingDataImplTest, PreloadingAttemptPrecisionAndRecall) { … }
namespace {
void RunSamplingTest(WebContents* web_contents,
int num_predictions,
int expected_sampling_amount_bucket) { … }
}
TEST_F(PreloadingDataImplTest, MaxPredictions) { … }
TEST_F(PreloadingDataImplTest, NoSamplingUnderMaxPredictions) { … }
}