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

Unified Diff: chrome/browser/errorpage_uitest.cc

Issue 175006: Wait correctly for all navigations that will happen in ErrorPageTest. (Closed)
Patch Set: Created 11 years, 4 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/errorpage_uitest.cc
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc
index 3e34822fcf887d82c3e5eb312842c41c369f7e58..409cca0eb240372177b060932ff823900b9d8027 100644
--- a/chrome/browser/errorpage_uitest.cc
+++ b/chrome/browser/errorpage_uitest.cc
@@ -46,7 +46,9 @@ TEST_F(ErrorPageTest, DNSError_GoBack1) {
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(test_url);
+ // The first navigation should fail, and the second one should be the error
+ // page.
+ NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleContaining(test_url.host()));
GetActiveTab()->GoBack();
@@ -60,7 +62,9 @@ TEST_F(ErrorPageTest, DNSError_GoBack2) {
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(test_url);
+ // The first navigation should fail, and the second one should be the error
+ // page.
+ NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleContaining(test_url.host()));
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title3.html"));
@@ -80,7 +84,9 @@ TEST_F(ErrorPageTest, DNSError_GoBack2AndForward) {
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(test_url);
+ // The first navigation should fail, and the second one should be the error
+ // page.
+ NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleContaining(test_url.host()));
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title3.html"));
@@ -103,7 +109,9 @@ TEST_F(ErrorPageTest, DNSError_GoBack2Forward2) {
GURL test_url(URLRequestFailedDnsJob::kTestUrl);
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title3.html"));
- NavigateToURL(test_url);
+ // The first navigation should fail, and the second one should be the error
+ // page.
+ NavigateToURLBlockUntilNavigationsComplete(test_url, 2);
EXPECT_TRUE(WaitForTitleContaining(test_url.host()));
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
@@ -165,22 +173,22 @@ TEST_F(ErrorPageTest, IFrame404) {
EXPECT_TRUE(WaitForTitleMatching(L"SUCCESS"));
}
-#if defined(OS_LINUX)
-// TODO(phajdan.jr): This test is flaky on Linux, http://crbug.com/19361
-#define Page404 DISABLED_Page404
-#define Page404_GoBack DISABLED_Page404_GoBack
-#endif
-
TEST_F(ErrorPageTest, Page404) {
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html"));
+ // The first navigation should fail, and the second one should be the error
+ // page.
+ NavigateToURLBlockUntilNavigationsComplete(
+ URLRequestMockHTTPJob::GetMockUrl(L"page404.html"), 2);
EXPECT_TRUE(WaitForTitleContaining("page404.html"));
}
TEST_F(ErrorPageTest, Page404_GoBack) {
NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"title2.html"));
- NavigateToURL(URLRequestMockHTTPJob::GetMockUrl(L"page404.html"));
+ // The first navigation should fail, and the second one should be the error
+ // page.
+ NavigateToURLBlockUntilNavigationsComplete(
+ URLRequestMockHTTPJob::GetMockUrl(L"page404.html"), 2);
EXPECT_TRUE(WaitForTitleContaining("page404.html"));
GetActiveTab()->GoBack();
« 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