Commit 480437b2 authored by Alan Cutter's avatar Alan Cutter Committed by Commit Bot

Add missing instantiations for ResourceLoadingHintsBrowserTest subclasses

This CL adds instantiations for:
 - ResourceLoadingHintsBrowserTestWithExperimentEnabled
 - ResourceLoadingHintsBrowserTestWithExperimentDisabled
 - ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback

This CL fixes the warnings thrown by browser_tests:
[test_launcher.cc(1498)] The following parameterized test case is not instantiated: UninstantiatedParamaterizedTestSuite<ResourceLoadingHintsBrowserTestWithExperimentEnabled>
[test_launcher.cc(1498)] The following parameterized test case is not instantiated: UninstantiatedParamaterizedTestSuite<ResourceLoadingHintsBrowserTestWithExperimentDisabled>
[test_launcher.cc(1498)] The following parameterized test case is not instantiated: UninstantiatedParamaterizedTestSuite<ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback>

Change-Id: Idf98ff3a53a377b34b3dfb5340faa379b45e13e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2053230
Auto-Submit: Alan Cutter <alancutter@chromium.org>
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741202}
parent 9622fc5c
......@@ -405,16 +405,21 @@ class ResourceLoadingHintsBrowserTest
void SetUp() override {
// Enabling NoScript should have no effect since resource loading takes
// priority over NoScript.
scoped_feature_list_.InitWithFeatures(
{previews::features::kPreviews, previews::features::kNoScriptPreviews,
optimization_guide::features::kOptimizationHints,
previews::features::kResourceLoadingHints,
data_reduction_proxy::features::
kDataReductionProxyEnabledWithNetworkService},
{});
scoped_feature_list_.InitWithFeatures(
{previews::features::kPreviews, previews::features::kNoScriptPreviews,
optimization_guide::features::kOptimizationHints,
previews::features::kResourceLoadingHints,
data_reduction_proxy::features::
kDataReductionProxyEnabledWithNetworkService},
{});
// Any additional ScopedFeatureLists added by subclasses must be
// instantiated here to get destructed in the correct order.
InitExtraFeatures();
ResourceLoadingNoFeaturesBrowserTest::SetUp();
}
virtual void InitExtraFeatures() {}
PageToUse test_page_to_use() const { return test_page_to_use_; }
GURL GetURLWithMockHost(const net::EmbeddedTestServer& server,
......@@ -655,7 +660,7 @@ IN_PROC_BROWSER_TEST_P(
class ResourceLoadingHintsBrowserTestWithExperimentEnabled
: public ResourceLoadingHintsBrowserTest {
public:
ResourceLoadingHintsBrowserTestWithExperimentEnabled() {
void InitExtraFeatures() override {
feature_list_.InitAndEnableFeatureWithParameters(
optimization_guide::features::kOptimizationHintsExperiments,
{{optimization_guide::features::kOptimizationHintsExperimentNameParam,
......@@ -666,6 +671,11 @@ class ResourceLoadingHintsBrowserTestWithExperimentEnabled
base::test::ScopedFeatureList feature_list_;
};
// First parameter determines the test webpage that should be used.
INSTANTIATE_TEST_SUITE_P(All,
ResourceLoadingHintsBrowserTestWithExperimentEnabled,
::testing::Values(REGULAR_PAGE, PRELOAD_PAGE));
// Sets only the experimental hints, and enables the matching experiment.
// Verifies that the hints are used, and the resource loading is blocked.
IN_PROC_BROWSER_TEST_P(ResourceLoadingHintsBrowserTestWithExperimentEnabled,
......@@ -834,7 +844,7 @@ IN_PROC_BROWSER_TEST_P(
class ResourceLoadingHintsBrowserTestWithExperimentDisabled
: public ResourceLoadingHintsBrowserTest {
public:
ResourceLoadingHintsBrowserTestWithExperimentDisabled() {
void InitExtraFeatures() override {
feature_list_.InitAndEnableFeatureWithParameters(
optimization_guide::features::kOptimizationHintsExperiments,
{{optimization_guide::features::kOptimizationHintsExperimentNameParam,
......@@ -845,6 +855,11 @@ class ResourceLoadingHintsBrowserTestWithExperimentDisabled
base::test::ScopedFeatureList feature_list_;
};
// First parameter determines the test webpage that should be used.
INSTANTIATE_TEST_SUITE_P(All,
ResourceLoadingHintsBrowserTestWithExperimentDisabled,
::testing::Values(REGULAR_PAGE, PRELOAD_PAGE));
// Sets both the experimental and default hints, but does not enable the
// matching experiment. Verifies that the hints from the experiment are not
// used.
......@@ -985,7 +1000,7 @@ IN_PROC_BROWSER_TEST_P(ResourceLoadingHintsBrowserTest,
class ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback
: public ResourceLoadingHintsBrowserTest {
public:
ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback() {
void InitExtraFeatures() override {
// Holdback the page load from previews and also disable offline previews to
// ensure that only post-commit previews are enabled.
feature_list_.InitWithFeaturesAndParameters(
......@@ -998,6 +1013,12 @@ class ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback
base::test::ScopedFeatureList feature_list_;
};
// First parameter determines the test webpage that should be used.
INSTANTIATE_TEST_SUITE_P(
All,
ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback,
::testing::Values(REGULAR_PAGE, PRELOAD_PAGE));
IN_PROC_BROWSER_TEST_P(
ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback,
DISABLE_ON_WIN_MAC_CHROMEOS(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment