diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-10 11:35:27 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-10 11:35:27 +0000 |
commit | b1df09c7e09e9578531e97aeb5e0a5ac92447234 (patch) | |
tree | 55d2da50f1b31f38ef047d83dd1915e2475b27f5 | |
parent | 646660a6ff0341615a2af5a935c3cc1c7a847cc2 (diff) | |
download | chromium_src-b1df09c7e09e9578531e97aeb5e0a5ac92447234.zip chromium_src-b1df09c7e09e9578531e97aeb5e0a5ac92447234.tar.gz chromium_src-b1df09c7e09e9578531e97aeb5e0a5ac92447234.tar.bz2 |
Revert the part of http://codereview.chromium.org/593018 touching unload_uitest.cc
The test started to hang mysteriously on Linux Tests(dbg)(1) and I remember some
past problems about this test. Would need more investigation. The test is
fine on all other platforms and bots, including Linux Tests(dbg)(2).
TBR=brettw
TEST=stop hanging
BUG=none
Review URL: http://codereview.chromium.org/597020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38611 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/unload_uitest.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc index 2bbe357..86d0a82 100644 --- a/chrome/browser/unload_uitest.cc +++ b/chrome/browser/unload_uitest.cc @@ -103,19 +103,32 @@ class UnloadTest : public UITest { } } + void CheckTitle(const std::wstring& expected_title) { + const int kCheckDelayMs = 100; + int max_wait_time = 5000; + while (max_wait_time > 0) { + max_wait_time -= kCheckDelayMs; + PlatformThread::Sleep(kCheckDelayMs); + if (expected_title == GetActiveTabTitle()) + break; + } + + EXPECT_EQ(expected_title, GetActiveTabTitle()); + } + void NavigateToDataURL(const std::string& html_content, const std::wstring& expected_title) { NavigateToURL(GURL("data:text/html," + html_content)); - EXPECT_EQ(expected_title, GetActiveTabTitle()); + CheckTitle(expected_title); } void NavigateToNolistenersFileTwice() { NavigateToURL(URLRequestMockHTTPJob::GetMockUrl( FilePath(FILE_PATH_LITERAL("title2.html")))); - EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle()); + CheckTitle(L"Title Of Awesomeness"); NavigateToURL(URLRequestMockHTTPJob::GetMockUrl( FilePath(FILE_PATH_LITERAL("title2.html")))); - EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle()); + CheckTitle(L"Title Of Awesomeness"); } // Navigates to a URL asynchronously, then again synchronously. The first @@ -133,7 +146,7 @@ class UnloadTest : public UITest { URLRequestMockHTTPJob::GetMockUrl( FilePath(FILE_PATH_LITERAL("title2.html")))); - EXPECT_EQ(L"Title Of Awesomeness", GetActiveTabTitle()); + CheckTitle(L"Title Of Awesomeness"); } void LoadUrlAndQuitBrowser(const std::string& html_content, |