Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3572)

Unified Diff: chrome/browser/subresource_filter/subresource_filter_browsertest.cc

Issue 2754173003: Make SubresourceFilterBrowserTest.FailedProvisionalLoadInMainframe non-flaky. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/subresource_filter/subresource_filter_browsertest.cc
diff --git a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
index 73312ad27fe43f352030f66c5c17c35d0ee10255..d41cbab11b67390fc66487900fd9662df8e2f5d4 100644
--- a/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_browsertest.cc
@@ -523,13 +523,7 @@ IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest,
FailedProvisionalLoadInMainframe) {
GURL url_with_activation_but_dns_error(
"http://host-with-dns-lookup-failure/");
- // The /echo handler returns a 404 with a non-empty response body (containing
- // the text 'Echo`). The latter is important to suppress showing Chrome's own
- // navigation error page, in which case a background request is started to
- // load navigation corrections (aka. Link Doctor), and once the results are
- // back, there is a navigation to a second error page with the suggestions,
- // which makes WaitForLoadStop() in the second NavigateToURL() below racey.
- GURL url_with_activation_but_not_existent(GetTestUrl("/echo?status=404"));
+ GURL url_with_activation_but_not_existent(GetTestUrl("non-existent.html"));
GURL url_without_activation(GetTestUrl(kTestFrameSetPath));
ConfigureAsPhishingURL(url_with_activation_but_dns_error);
@@ -545,7 +539,13 @@ IN_PROC_BROWSER_TEST_F(SubresourceFilterBrowserTest,
url_with_activation_but_not_existent}) {
SCOPED_TRACE(url_with_activation);
- ui_test_utils::NavigateToURL(browser(), url_with_activation);
+ // In either test case, there is no server-supplied error page, so Chrome's
+ // own navigation error page is shown. This also triggers a background
+ // request to load navigation corrections (aka. Link Doctor), and once the
+ // results are back, there is a navigation to a second error page with the
+ // suggestions. Hence the wait for two navigations in a row.
+ ui_test_utils::NavigateToURLBlockUntilNavigationsComplete(
+ browser(), url_with_activation, 2);
ui_test_utils::NavigateToURL(browser(), url_without_activation);
ASSERT_NO_FATAL_FAILURE(ExpectParsedScriptElementLoadedStatusInFrames(
kSubframeNames, kExpectScriptInFrameToLoad));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698