diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 09:32:01 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-11 09:32:01 +0000 |
commit | 94b7900b6ba259399f43d098294474c26418e1ab (patch) | |
tree | bab3e1edbadee10923c3cf1614fee13f94f0b48a /chrome | |
parent | 270756a8deb80a7bf9d137b5ad08607e813b9527 (diff) | |
download | chromium_src-94b7900b6ba259399f43d098294474c26418e1ab.zip chromium_src-94b7900b6ba259399f43d098294474c26418e1ab.tar.gz chromium_src-94b7900b6ba259399f43d098294474c26418e1ab.tar.bz2 |
[GTTF] Make ResourceDispatcherTest.CrossSiteNavigationErrorPage faster
and more solid.
Sleeping for about 6 seconds is not a good idea.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/385010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc index 086dd50..6b45924 100644 --- a/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc +++ b/chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc @@ -271,18 +271,12 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) { EXPECT_TRUE(tab->GetTabTitle(&tab_title)); EXPECT_EQ(L"set cookie on unload", tab_title); - // Navigate to a new cross-site URL that results in an error page. We must - // wait for the error page to update the title. + // Navigate to a new cross-site URL that results in an error page. // TODO(creis): If this causes crashes or hangs, it might be for the same - // reason as ErrorPageTest::DNSError. See bug 1199491. - tab->NavigateToURL(GURL(URLRequestFailedDnsJob::kTestUrl)); - for (int i = 0; i < 10; ++i) { - PlatformThread::Sleep(sleep_timeout_ms()); - if (GetActiveTabTitle() != L"set cookie on unload") { - // Success, bail out. - break; - } - } + // reason as ErrorPageTest::DNSError. See bug 1199491 and + // http://crbug.com/22877. + tab->NavigateToURLBlockUntilNavigationsComplete( + GURL(URLRequestFailedDnsJob::kTestUrl), 2); EXPECT_NE(L"set cookie on unload", GetActiveTabTitle()); // Check that the cookie was set, meaning that the onunload handler ran. @@ -300,9 +294,7 @@ TEST_F(ResourceDispatcherTest, CrossSiteNavigationErrorPage) { GURL test_url(server->TestServerPageW(L"files/title2.html")); std::string redirect_url = "javascript:window.location='" + test_url.possibly_invalid_spec() + "'"; - tab->NavigateToURLAsync(GURL(redirect_url)); - // Wait for JavaScript redirect to happen. - PlatformThread::Sleep(sleep_timeout_ms() * 3); + tab->NavigateToURL(GURL(redirect_url)); EXPECT_TRUE(tab->GetTabTitle(&tab_title)); EXPECT_EQ(L"Title Of Awesomeness", tab_title); } |