Commit c75f72c3 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Fix failing TSAN test in IsolatedPrerender

This fails because the ScopedFeature list was being destroyed before
the test was fully done.

Bug: 1078965
Change-Id: I57d4c01bc4bcc10a8377e4abac5f5b65f9ea9859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351168Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797464}
parent e526ef70
...@@ -1592,9 +1592,6 @@ class IsolatedPrerenderTabHelperRedirectTest ...@@ -1592,9 +1592,6 @@ class IsolatedPrerenderTabHelperRedirectTest
GURL doc_url("https://www.google.com/search?q=cats"); GURL doc_url("https://www.google.com/search?q=cats");
GURL prediction_url("https://www.cat-food.com/"); GURL prediction_url("https://www.cat-food.com/");
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kIsolatePrerenders);
MakeNavigationPrediction(web_contents(), doc_url, {prediction_url}); MakeNavigationPrediction(web_contents(), doc_url, {prediction_url});
VerifyCommonRequestState(prediction_url); VerifyCommonRequestState(prediction_url);
...@@ -1604,13 +1601,9 @@ class IsolatedPrerenderTabHelperRedirectTest ...@@ -1604,13 +1601,9 @@ class IsolatedPrerenderTabHelperRedirectTest
} }
}; };
// Fails on TSAN builders: https://crbug.com/1078965. TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Cookies) {
#if defined(THREAD_SANITIZER) base::test::ScopedFeatureList scoped_feature_list;
#define MAYBE_NoRedirect_Cookies DISABLED_NoRedirect_Cookies scoped_feature_list.InitAndEnableFeature(features::kIsolatePrerenders);
#else
#define MAYBE_NoRedirect_Cookies NoRedirect_Cookies
#endif
TEST_F(IsolatedPrerenderTabHelperRedirectTest, MAYBE_NoRedirect_Cookies) {
NavigateSomewhere(); NavigateSomewhere();
GURL site_with_cookies("https://cookies.com"); GURL site_with_cookies("https://cookies.com");
...@@ -1632,6 +1625,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, MAYBE_NoRedirect_Cookies) { ...@@ -1632,6 +1625,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, MAYBE_NoRedirect_Cookies) {
} }
TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure) { TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kIsolatePrerenders);
NavigateSomewhere(); NavigateSomewhere();
GURL url("http://insecure.com"); GURL url("http://insecure.com");
...@@ -1653,6 +1648,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure) { ...@@ -1653,6 +1648,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure) {
} }
TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure_Continued) { TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure_Continued) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kIsolatePrerenders);
NavigateSomewhere(); NavigateSomewhere();
GURL url("http://insecure.com"); GURL url("http://insecure.com");
...@@ -1690,6 +1687,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure_Continued) { ...@@ -1690,6 +1687,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Insecure_Continued) {
} }
TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Google) { TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Google) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kIsolatePrerenders);
NavigateSomewhere(); NavigateSomewhere();
GURL url("https://www.google.com"); GURL url("https://www.google.com");
...@@ -1711,6 +1710,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Google) { ...@@ -1711,6 +1710,8 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_Google) {
} }
TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_ServiceWorker) { TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_ServiceWorker) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeature(features::kIsolatePrerenders);
NavigateSomewhere(); NavigateSomewhere();
GURL site_with_worker("https://service-worker.com"); GURL site_with_worker("https://service-worker.com");
...@@ -1735,18 +1736,18 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_ServiceWorker) { ...@@ -1735,18 +1736,18 @@ TEST_F(IsolatedPrerenderTabHelperRedirectTest, NoRedirect_ServiceWorker) {
} }
TEST_F(IsolatedPrerenderTabHelperRedirectTest, SuccessfulRedirect) { TEST_F(IsolatedPrerenderTabHelperRedirectTest, SuccessfulRedirect) {
base::HistogramTester histogram_tester;
NavigateSomewhere();
GURL doc_url("https://www.google.com/search?q=cats");
GURL prediction_url("https://www.cat-food.com/");
GURL redirect_url("https://redirect-here.com");
// Enable unlimited prefetches so we can follow the redirect chain all the // Enable unlimited prefetches so we can follow the redirect chain all the
// way. // way.
base::test::ScopedFeatureList scoped_feature_list; base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndEnableFeatureWithParameters( scoped_feature_list.InitAndEnableFeatureWithParameters(
features::kIsolatePrerenders, {{"max_srp_prefetches", "-1"}}); features::kIsolatePrerenders, {{"max_srp_prefetches", "-1"}});
base::HistogramTester histogram_tester;
NavigateSomewhere();
GURL doc_url("https://www.google.com/search?q=cats");
GURL prediction_url("https://www.cat-food.com/");
GURL redirect_url("https://redirect-here.com");
MakeNavigationPrediction(web_contents(), doc_url, {prediction_url}); MakeNavigationPrediction(web_contents(), doc_url, {prediction_url});
VerifyCommonRequestState(prediction_url); VerifyCommonRequestState(prediction_url);
......
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