OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); | 728 ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); |
729 | 729 |
730 // There should have been two more requests to the correction service: One | 730 // There should have been two more requests to the correction service: One |
731 // for the new error page, and one for tracking purposes. Have to make sure | 731 // for the new error page, and one for tracking purposes. Have to make sure |
732 // to wait for the tracking request, since the new error page does not depend | 732 // to wait for the tracking request, since the new error page does not depend |
733 // on it. | 733 // on it. |
734 link_doctor_interceptor()->WaitForRequests(3); | 734 link_doctor_interceptor()->WaitForRequests(3); |
735 EXPECT_EQ(3, link_doctor_interceptor()->num_requests()); | 735 EXPECT_EQ(3, link_doctor_interceptor()->num_requests()); |
736 } | 736 } |
737 | 737 |
738 // Test that the reload button on a DNS error page works after a same page | 738 // Test that the reload button on a DNS error page works after a same document |
739 // navigation on the error page. Error pages don't seem to do this, but some | 739 // navigation on the error page. Error pages don't seem to do this, but some |
740 // traces indicate this may actually happen. This test may hang on regression. | 740 // traces indicate this may actually happen. This test may hang on regression. |
741 IN_PROC_BROWSER_TEST_F(ErrorPageTest, | 741 IN_PROC_BROWSER_TEST_F(ErrorPageTest, |
742 DNSError_DoReloadAfterSamePageNavigation) { | 742 DNSError_DoReloadAfterSameDocumentNavigation) { |
743 // The first navigation should fail, and the second one should be the error | 743 // The first navigation should fail, and the second one should be the error |
744 // page. | 744 // page. |
745 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 745 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
746 browser(), GetDnsErrorURL(), 2); | 746 browser(), GetDnsErrorURL(), 2); |
747 ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); | 747 ExpectDisplayingNavigationCorrections(browser(), net::ERR_NAME_NOT_RESOLVED); |
748 EXPECT_EQ(1, link_doctor_interceptor()->num_requests()); | 748 EXPECT_EQ(1, link_doctor_interceptor()->num_requests()); |
749 | 749 |
750 content::WebContents* web_contents = | 750 content::WebContents* web_contents = |
751 browser()->tab_strip_model()->GetActiveWebContents(); | 751 browser()->tab_strip_model()->GetActiveWebContents(); |
752 | 752 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 content::WebContents* web_contents = | 1125 content::WebContents* web_contents = |
1126 browser()->tab_strip_model()->GetActiveWebContents(); | 1126 browser()->tab_strip_model()->GetActiveWebContents(); |
1127 content::TestNavigationObserver nav_observer(web_contents, 1); | 1127 content::TestNavigationObserver nav_observer(web_contents, 1); |
1128 web_contents->GetMainFrame()->ExecuteJavaScriptForTests( | 1128 web_contents->GetMainFrame()->ExecuteJavaScriptForTests( |
1129 base::ASCIIToUTF16("document.getElementById('reload-button').click();")); | 1129 base::ASCIIToUTF16("document.getElementById('reload-button').click();")); |
1130 nav_observer.Wait(); | 1130 nav_observer.Wait(); |
1131 EXPECT_FALSE(IsDisplayingText(browser(), l10n_util::GetStringUTF8( | 1131 EXPECT_FALSE(IsDisplayingText(browser(), l10n_util::GetStringUTF8( |
1132 IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER))); | 1132 IDS_ERRORPAGES_SUGGESTION_CHECK_CONNECTION_HEADER))); |
1133 } | 1133 } |
1134 | 1134 |
1135 // Make sure that a same page navigation does not cause issues with the | 1135 // Make sure that a same document navigation does not cause issues with the |
1136 // auto-reload timer. Note that this test was added due to this case causing | 1136 // auto-reload timer. Note that this test was added due to this case causing |
1137 // a crash. On regression, this test may hang due to a crashed renderer. | 1137 // a crash. On regression, this test may hang due to a crashed renderer. |
1138 IN_PROC_BROWSER_TEST_F(ErrorPageAutoReloadTest, IgnoresSamePageNavigation) { | 1138 IN_PROC_BROWSER_TEST_F(ErrorPageAutoReloadTest, IgnoresSameDocumentNavigation) { |
1139 GURL test_url("http://error.page.auto.reload"); | 1139 GURL test_url("http://error.page.auto.reload"); |
1140 InstallInterceptor(test_url, 2); | 1140 InstallInterceptor(test_url, 2); |
1141 | 1141 |
1142 // Wait for the error page and first autoreload, which happens immediately. | 1142 // Wait for the error page and first autoreload, which happens immediately. |
1143 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 1143 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
1144 browser(), test_url, 2); | 1144 browser(), test_url, 2); |
1145 | 1145 |
1146 EXPECT_EQ(2, interceptor()->failures()); | 1146 EXPECT_EQ(2, interceptor()->failures()); |
1147 EXPECT_EQ(2, interceptor()->requests()); | 1147 EXPECT_EQ(2, interceptor()->requests()); |
1148 | 1148 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 Http09WeirdPortEnabled) { | 1530 Http09WeirdPortEnabled) { |
1531 const char kHttp09Response[] = "JumboShrimp"; | 1531 const char kHttp09Response[] = "JumboShrimp"; |
1532 ASSERT_TRUE(embedded_test_server()->Start()); | 1532 ASSERT_TRUE(embedded_test_server()->Start()); |
1533 ui_test_utils::NavigateToURL( | 1533 ui_test_utils::NavigateToURL( |
1534 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + | 1534 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + |
1535 kHttp09Response)); | 1535 kHttp09Response)); |
1536 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); | 1536 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); |
1537 } | 1537 } |
1538 | 1538 |
1539 } // namespace | 1539 } // namespace |
OLD | NEW |