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

Unified Diff: chrome/browser/net/errorpage_browsertest.cc

Issue 2917133002: Perform redirect checks before OnReceivedRedirect in //net. (Closed)
Patch Set: nasko comments Created 3 years, 6 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 | components/error_page/common/localized_error.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/errorpage_browsertest.cc
diff --git a/chrome/browser/net/errorpage_browsertest.cc b/chrome/browser/net/errorpage_browsertest.cc
index a328daa7a7dfc4324c4c843aba8d212e2036ee76..69b34a9197f11cc864510ff8e72ddcd47f922242 100644
--- a/chrome/browser/net/errorpage_browsertest.cc
+++ b/chrome/browser/net/errorpage_browsertest.cc
@@ -1515,6 +1515,20 @@ IN_PROC_BROWSER_TEST_F(ErrorPageTest, Http09WeirdPort) {
ExpectDisplayingLocalErrorPage(browser(), net::ERR_INVALID_HTTP_RESPONSE);
}
+// Test that redirects to invalid URLs show an error. See
+// https://crbug.com/462272.
+IN_PROC_BROWSER_TEST_F(ErrorPageTest, RedirectToInvalidURL) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+ GURL url = embedded_test_server()->GetURL("/server-redirect?https://:");
+ ui_test_utils::NavigateToURL(browser(), url);
+ ExpectDisplayingLocalErrorPage(browser(), net::ERR_INVALID_REDIRECT);
+ // The error page should commit before the redirect, not after.
+ EXPECT_EQ(url, browser()
+ ->tab_strip_model()
+ ->GetActiveWebContents()
+ ->GetLastCommittedURL());
+}
+
class ErrorPageWithHttp09OnNonDefaultPortsTest : public InProcessBrowserTest {
public:
// InProcessBrowserTest:
« no previous file with comments | « no previous file | components/error_page/common/localized_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698