diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 18:45:45 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 18:45:45 +0000 |
commit | d0033329c98edaf3fff226aabe8f5adc7aa10c62 (patch) | |
tree | c9f400c195784b778ca8dc24a945abcf91a4ec5c /chrome/browser/views/find_bar_win_uitest.cc | |
parent | d53b4ad91e57d3cf64c3188a89843242c75347aa (diff) | |
download | chromium_src-d0033329c98edaf3fff226aabe8f5adc7aa10c62.zip chromium_src-d0033329c98edaf3fff226aabe8f5adc7aa10c62.tar.gz chromium_src-d0033329c98edaf3fff226aabe8f5adc7aa10c62.tar.bz2 |
Fix 8063: Find-in-page remains open on History/Downloads page.
Added a UI test to catch this in the future. Also, in some of the UI tests I added a generic URL for pages that don't care about the content of the page and are just testing visibility of the Find box, etc.
TEST=Covered by tests already.
BUG=8063
Review URL: http://codereview.chromium.org/28162
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_win_uitest.cc')
-rw-r--r-- | chrome/browser/views/find_bar_win_uitest.cc | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/chrome/browser/views/find_bar_win_uitest.cc b/chrome/browser/views/find_bar_win_uitest.cc index 21d2287..88dc0ed 100644 --- a/chrome/browser/views/find_bar_win_uitest.cc +++ b/chrome/browser/views/find_bar_win_uitest.cc @@ -17,6 +17,7 @@ class FindInPageControllerTest : public UITest { } }; +const std::wstring kSimplePage = L"404_is_enough_for_us.html"; const std::wstring kFramePage = L"files/find_in_page/frames.html"; const std::wstring kFrameData = L"files/find_in_page/framedata_general.html"; const std::wstring kUserSelectPage = L"files/find_in_page/user-select.html"; @@ -198,7 +199,7 @@ TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); - GURL url = server->TestServerPageW(kFramePage); + GURL url = server->TestServerPageW(kSimplePage); scoped_ptr<TabProxy> tabA(GetActiveTab()); ASSERT_TRUE(tabA->NavigateToURL(url)); WaitUntilTabCount(1); @@ -259,7 +260,7 @@ TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { HTTPTestServer::CreateServer(L"chrome/test/data", NULL); ASSERT_TRUE(NULL != server.get()); - GURL url = server->TestServerPageW(kUserSelectPage); + GURL url = server->TestServerPageW(kSimplePage); GURL url2 = server->TestServerPageW(kFramePage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); @@ -280,3 +281,42 @@ TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { EXPECT_TRUE(tab->NavigateToURL(url2)); EXPECT_TRUE(WaitForFindWindowVisibilityChange(browser.get(), false)); } + +// Make sure Find box disappears when History/Downloads page is opened, and +// when a New Tab is opened. +TEST_F(FindInPageControllerTest, FindDisappearOnNewTabAndHistory) { + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data", NULL); + ASSERT_TRUE(NULL != server.get()); + + GURL url = server->TestServerPageW(kSimplePage); + scoped_ptr<TabProxy> tab(GetActiveTab()); + ASSERT_TRUE(tab->NavigateToURL(url)); + WaitUntilTabCount(1); + + scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); + ASSERT_TRUE(browser.get() != NULL); + + // Open the Find window and wait for it to animate. + EXPECT_TRUE(browser->OpenFindInPage()); + EXPECT_TRUE(WaitForFindWindowVisibilityChange(browser.get(), true)); + + // Open another tab (tab B). + EXPECT_TRUE(browser->AppendTab(url)); + scoped_ptr<TabProxy> tabB(GetActiveTab()); + + // Wait for the Find box to disappear. + EXPECT_TRUE(WaitForFindWindowVisibilityChange(browser.get(), false)); + + // Close tab B. + EXPECT_TRUE(tabB->Close(true)); + + // Wait for the Find box to appear again. + EXPECT_TRUE(WaitForFindWindowVisibilityChange(browser.get(), true)); + + // Open History page. + EXPECT_TRUE(browser->RunCommand(IDC_SHOW_HISTORY)); + + // Wait for the Find box to disappear. + EXPECT_TRUE(WaitForFindWindowVisibilityChange(browser.get(), false)); +} |