diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 00:07:22 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 00:07:22 +0000 |
commit | fd9526f3b0b79040d62c63d1cfcc9bc0c0903a7d (patch) | |
tree | fca6b85bd3dcf3bcc3c9c29393112f4ff995cde4 /chrome/browser/errorpage_uitest.cc | |
parent | e12de87eca9b85c26152c32e349d84670c5dcb54 (diff) | |
download | chromium_src-fd9526f3b0b79040d62c63d1cfcc9bc0c0903a7d.zip chromium_src-fd9526f3b0b79040d62c63d1cfcc9bc0c0903a7d.tar.gz chromium_src-fd9526f3b0b79040d62c63d1cfcc9bc0c0903a7d.tar.bz2 |
Wait correctly for all navigations that will happen in ErrorPageTest.
Will it kill flakiness? I'm undisabling some tests on Linux to find out.
TEST=none
http://crbug.com/19361
Review URL: http://codereview.chromium.org/175006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/errorpage_uitest.cc')
-rw-r--r-- | chrome/browser/errorpage_uitest.cc | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc index 3e34822..409cca0 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(); |