#include "base/metrics/field_trial_params.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "chrome/browser/navigation_predictor/anchor_element_preloader.h"
#include "chrome/browser/predictors/loading_predictor.h"
#include "chrome/browser/predictors/loading_predictor_factory.h"
#include "chrome/browser/predictors/preconnect_manager.h"
#include "chrome/browser/preloading/chrome_preloading.h"
#include "chrome/browser/preloading/preloading_prefs.h"
#include "chrome/browser/subresource_filter/subresource_filter_browser_test_harness.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
#include "components/ukm/test_ukm_recorder.h"
#include "content/public/browser/preloading.h"
#include "content/public/common/content_features.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/preloading_test_util.h"
#include "net/base/features.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "ui/gfx/geometry/point_conversions.h"
namespace {
UkmEntry;
Preloading_Attempt;
class AnchorElementPreloaderBrowserTest
: public subresource_filter::SubresourceFilterBrowserTest,
public predictors::PreconnectManager::Observer { … };
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderBrowserTest, OneAnchor) { … }
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderBrowserTest, OneAnchorInaccurate) { … }
#if BUILDFLAG(IS_WIN)
#define MAYBE_Duplicates …
#else
#define MAYBE_Duplicates …
#endif
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderBrowserTest, MAYBE_Duplicates) { … }
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderBrowserTest, InvalidHref) { … }
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderBrowserTest, DISABLED_IframeTest) { … }
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderBrowserTest,
UserSettingDisabledTest) { … }
class AnchorElementPreloaderHoldbackBrowserTest
: public AnchorElementPreloaderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderHoldbackBrowserTest,
PreconnectHoldbackTest) { … }
class AnchorElementPreloaderLimitedBrowserTest
: public AnchorElementPreloaderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(AnchorElementPreloaderLimitedBrowserTest,
DISABLED_LimitExceeded) { … }
class AnchorElementSetIsNavigationInDomainBrowserTest
: public AnchorElementPreloaderBrowserTest { … };
IN_PROC_BROWSER_TEST_F(AnchorElementSetIsNavigationInDomainBrowserTest,
TestPointerDownOnAnchor) { … }
}