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 ...@@ -405,16 +405,21 @@ class ResourceLoadingHintsBrowserTest
void SetUp() override { void SetUp() override {
// Enabling NoScript should have no effect since resource loading takes // Enabling NoScript should have no effect since resource loading takes
// priority over NoScript. // priority over NoScript.
scoped_feature_list_.InitWithFeatures( scoped_feature_list_.InitWithFeatures(
{previews::features::kPreviews, previews::features::kNoScriptPreviews, {previews::features::kPreviews, previews::features::kNoScriptPreviews,
optimization_guide::features::kOptimizationHints, optimization_guide::features::kOptimizationHints,
previews::features::kResourceLoadingHints, previews::features::kResourceLoadingHints,
data_reduction_proxy::features:: data_reduction_proxy::features::
kDataReductionProxyEnabledWithNetworkService}, kDataReductionProxyEnabledWithNetworkService},
{}); {});
// Any additional ScopedFeatureLists added by subclasses must be
// instantiated here to get destructed in the correct order.
InitExtraFeatures();
ResourceLoadingNoFeaturesBrowserTest::SetUp(); ResourceLoadingNoFeaturesBrowserTest::SetUp();
} }
virtual void InitExtraFeatures() {}
PageToUse test_page_to_use() const { return test_page_to_use_; } PageToUse test_page_to_use() const { return test_page_to_use_; }
GURL GetURLWithMockHost(const net::EmbeddedTestServer& server, GURL GetURLWithMockHost(const net::EmbeddedTestServer& server,
...@@ -655,7 +660,7 @@ IN_PROC_BROWSER_TEST_P( ...@@ -655,7 +660,7 @@ IN_PROC_BROWSER_TEST_P(
class ResourceLoadingHintsBrowserTestWithExperimentEnabled class ResourceLoadingHintsBrowserTestWithExperimentEnabled
: public ResourceLoadingHintsBrowserTest { : public ResourceLoadingHintsBrowserTest {
public: public:
ResourceLoadingHintsBrowserTestWithExperimentEnabled() { void InitExtraFeatures() override {
feature_list_.InitAndEnableFeatureWithParameters( feature_list_.InitAndEnableFeatureWithParameters(
optimization_guide::features::kOptimizationHintsExperiments, optimization_guide::features::kOptimizationHintsExperiments,
{{optimization_guide::features::kOptimizationHintsExperimentNameParam, {{optimization_guide::features::kOptimizationHintsExperimentNameParam,
...@@ -666,6 +671,11 @@ class ResourceLoadingHintsBrowserTestWithExperimentEnabled ...@@ -666,6 +671,11 @@ class ResourceLoadingHintsBrowserTestWithExperimentEnabled
base::test::ScopedFeatureList feature_list_; 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. // Sets only the experimental hints, and enables the matching experiment.
// Verifies that the hints are used, and the resource loading is blocked. // Verifies that the hints are used, and the resource loading is blocked.
IN_PROC_BROWSER_TEST_P(ResourceLoadingHintsBrowserTestWithExperimentEnabled, IN_PROC_BROWSER_TEST_P(ResourceLoadingHintsBrowserTestWithExperimentEnabled,
...@@ -834,7 +844,7 @@ IN_PROC_BROWSER_TEST_P( ...@@ -834,7 +844,7 @@ IN_PROC_BROWSER_TEST_P(
class ResourceLoadingHintsBrowserTestWithExperimentDisabled class ResourceLoadingHintsBrowserTestWithExperimentDisabled
: public ResourceLoadingHintsBrowserTest { : public ResourceLoadingHintsBrowserTest {
public: public:
ResourceLoadingHintsBrowserTestWithExperimentDisabled() { void InitExtraFeatures() override {
feature_list_.InitAndEnableFeatureWithParameters( feature_list_.InitAndEnableFeatureWithParameters(
optimization_guide::features::kOptimizationHintsExperiments, optimization_guide::features::kOptimizationHintsExperiments,
{{optimization_guide::features::kOptimizationHintsExperimentNameParam, {{optimization_guide::features::kOptimizationHintsExperimentNameParam,
...@@ -845,6 +855,11 @@ class ResourceLoadingHintsBrowserTestWithExperimentDisabled ...@@ -845,6 +855,11 @@ class ResourceLoadingHintsBrowserTestWithExperimentDisabled
base::test::ScopedFeatureList feature_list_; 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 // Sets both the experimental and default hints, but does not enable the
// matching experiment. Verifies that the hints from the experiment are not // matching experiment. Verifies that the hints from the experiment are not
// used. // used.
...@@ -985,7 +1000,7 @@ IN_PROC_BROWSER_TEST_P(ResourceLoadingHintsBrowserTest, ...@@ -985,7 +1000,7 @@ IN_PROC_BROWSER_TEST_P(ResourceLoadingHintsBrowserTest,
class ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback class ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback
: public ResourceLoadingHintsBrowserTest { : public ResourceLoadingHintsBrowserTest {
public: public:
ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback() { void InitExtraFeatures() override {
// Holdback the page load from previews and also disable offline previews to // Holdback the page load from previews and also disable offline previews to
// ensure that only post-commit previews are enabled. // ensure that only post-commit previews are enabled.
feature_list_.InitWithFeaturesAndParameters( feature_list_.InitWithFeaturesAndParameters(
...@@ -998,6 +1013,12 @@ class ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback ...@@ -998,6 +1013,12 @@ class ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback
base::test::ScopedFeatureList feature_list_; 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( IN_PROC_BROWSER_TEST_P(
ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback, ResourceLoadingHintsBrowserTestWithCoinFlipAlwaysHoldback,
DISABLE_ON_WIN_MAC_CHROMEOS( 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