From 1692a966a15bfce0bcf9a21b548d8bdb46edcfc2 Mon Sep 17 00:00:00 2001 From: "finnur@google.com" Date: Fri, 19 Sep 2008 17:26:37 +0000 Subject: Attempt at fixing flaky Find test. The waterfall (build.chromium.org) has been complaining about this test for a while now. Nicolas and I looked at this, but we don't see anything wrong. We theorized this is because we issue Find right after the navigation and maybe the tab isn't ready. We'll see what happens with this change. Review URL: http://codereview.chromium.org/2978 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2411 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/find_in_page_controller_uitest.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'chrome/browser') diff --git a/chrome/browser/find_in_page_controller_uitest.cc b/chrome/browser/find_in_page_controller_uitest.cc index f26afa9..852248b 100644 --- a/chrome/browser/find_in_page_controller_uitest.cc +++ b/chrome/browser/find_in_page_controller_uitest.cc @@ -30,6 +30,7 @@ TEST_F(FindInPageControllerTest, FindInPageFrames) { GURL url = server.TestServerPageW(kFramePage); scoped_ptr tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); + WaitUntilTabCount(1); // Try incremental search (mimicking user typing in). EXPECT_EQ(18, tab->FindInPage(L"g", FWD, IGNORE_CASE, false)); @@ -75,6 +76,7 @@ TEST_F(FindInPageControllerTest, FindUnSelectableText) { GURL url = server.TestServerPageW(kUserSelectPage); scoped_ptr tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); + WaitUntilTabCount(1); EXPECT_EQ(0, tab->FindInPage(L"text", FWD, IGNORE_CASE, false)); EXPECT_EQ(0, tab->FindInPage(L"Non-existing string", FWD, IGNORE_CASE, @@ -88,6 +90,7 @@ TEST_F(FindInPageControllerTest, DISABLED_FindCrash_Issue1341577) { GURL url = server.TestServerPageW(kCrashPage); scoped_ptr tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); + WaitUntilTabCount(1); // This would crash the tab. These must be the first two find requests issued // against the frame, otherwise an active frame pointer is set and it wont @@ -108,12 +111,13 @@ TEST_F(FindInPageControllerTest, DISABLED_FindCrash_Issue1341577) { // 3) It takes longer than the time-slice given to each Find operation (100 // ms) to find one or more of those matches (so Find times out and has to try // again from where it left off). -TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1341577) { +TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1155639) { TestServer server(L"chrome/test/data"); GURL url = server.TestServerPageW(kTooFewMatchesPage); scoped_ptr tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); + WaitUntilTabCount(1); // This string appears 5 times at the bottom of a long page. If Find restarts // properly after a timeout, it will find 5 matches, not just 1. @@ -128,6 +132,7 @@ TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { GURL url = server.TestServerPageW(kFramePage); scoped_ptr tabA(GetActiveTab()); ASSERT_TRUE(tabA->NavigateToURL(url)); + WaitUntilTabCount(1); scoped_ptr browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get() != NULL); -- cgit v1.1