summaryrefslogtreecommitdiffstats
path: root/chrome/browser/find_bar_host_browsertest.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 22:50:23 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 22:50:23 +0000
commit0590ff113f399e23c2c72e0e4be9569c7596c2f6 (patch)
treeb67d01e5489e879f8a97947075e3a5404e1a9af3 /chrome/browser/find_bar_host_browsertest.cc
parent4f7336749506dead4f348f37171eda7165b5abb3 (diff)
downloadchromium_src-0590ff113f399e23c2c72e0e4be9569c7596c2f6.zip
chromium_src-0590ff113f399e23c2c72e0e4be9569c7596c2f6.tar.gz
chromium_src-0590ff113f399e23c2c72e0e4be9569c7596c2f6.tar.bz2
Finish porting FindInPageControllerTest to linux.
BUG=37809,268629 TEST=test passes Review URL: http://codereview.chromium.org/997004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/find_bar_host_browsertest.cc')
-rw-r--r--chrome/browser/find_bar_host_browsertest.cc62
1 files changed, 16 insertions, 46 deletions
diff --git a/chrome/browser/find_bar_host_browsertest.cc b/chrome/browser/find_bar_host_browsertest.cc
index 81f322c..508e5c8 100644
--- a/chrome/browser/find_bar_host_browsertest.cc
+++ b/chrome/browser/find_bar_host_browsertest.cc
@@ -18,14 +18,8 @@
#if defined(TOOLKIT_VIEWS)
#include "views/focus/focus_manager.h"
-#endif
-
-// http://crbug.com/37809
-#if defined(OS_LINUX) && defined(TOOLKIT_GTK)
-#define FindDisappearOnNavigate DISABLED_FindDisappearOnNavigate
-#define FindDisappearOnNewTabAndHistory \
- DISABLED_FindDisappearOnNewTabAndHistory
-#define FindMovesWhenObscuring DISABLED_FindMovesWhenObscuring
+#elif defined(TOOLKIT_GTK)
+#include "chrome/browser/gtk/slide_animator_gtk.h"
#endif
const std::wstring kSimplePage = L"404_is_enough_for_us.html";
@@ -55,6 +49,13 @@ class FindInPageControllerTest : public InProcessBrowserTest {
public:
FindInPageControllerTest() {
EnableDOMAutomation();
+
+#if defined(TOOLKIT_VIEWS)
+ DropdownBarHost::disable_animations_during_testing_ = true;
+#elif defined(TOOLKIT_GTK)
+ SlideAnimatorGtk::SetAnimationsForTesting(false);
+#endif
+
}
protected:
@@ -484,12 +485,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
EXPECT_EQ(1, ordinal);
}
-// Make sure Find box disappears on Navigate but not on Refresh.
-#if defined(OS_LINUX) && defined(TOOLKIT_VIEWS)
-// The last EXPECT_FALSE(fully_visible) is failing all the time on
-// the linux_views bot. See bug: http://crbug.com/28629.
-#define FindDisappearOnNavigate DISABLED_FindDisappearOnNavigate
-#endif
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) {
HTTPTestServer* server = StartHTTPServer();
@@ -498,29 +493,25 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) {
GURL url2 = server->TestServerPageW(kFramePage);
ui_test_utils::NavigateToURL(browser(), url);
-#if defined(TOOLKIT_VIEWS)
- // Open the Find window with animations disabled.
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
browser()->ShowFindBar();
- gfx::Point position;
bool fully_visible = false;
// Make sure it is open.
- EXPECT_TRUE(GetFindBarWindowInfo(&position, &fully_visible));
+ EXPECT_TRUE(GetFindBarWindowInfo(NULL, &fully_visible));
EXPECT_TRUE(fully_visible);
// Reload the tab and make sure Find window doesn't go away.
browser()->Reload();
+ ui_test_utils::WaitForNavigationInCurrentTab(browser());
- EXPECT_TRUE(GetFindBarWindowInfo(&position, &fully_visible));
+ EXPECT_TRUE(GetFindBarWindowInfo(NULL, &fully_visible));
EXPECT_TRUE(fully_visible);
// Navigate and make sure the Find window goes away.
ui_test_utils::NavigateToURL(browser(), url2);
- EXPECT_TRUE(GetFindBarWindowInfo(&position, &fully_visible));
+ EXPECT_TRUE(GetFindBarWindowInfo(NULL, &fully_visible));
EXPECT_FALSE(fully_visible);
}
@@ -534,10 +525,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
GURL url = server->TestServerPageW(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
-#if defined(TOOLKIT_VIEWS)
- // Open the Find window with animations disabled.
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
browser()->ShowFindBar();
gfx::Point position;
@@ -576,12 +563,11 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, FindMovesWhenObscuring) {
GURL url = server->TestServerPageW(kMoveIfOver);
ui_test_utils::NavigateToURL(browser(), url);
-#if defined(TOOLKIT_VIEWS)
- // Open the Find window with animations disabled.
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
browser()->ShowFindBar();
+ // This is needed on GTK because the reposition operation is asynchronous.
+ MessageLoop::current()->RunAllPending();
+
gfx::Point start_position;
gfx::Point position;
bool fully_visible = false;
@@ -700,10 +686,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
focus_manager->GetCurrentTargetForAccelerator(escape);
EXPECT_TRUE(old_target != NULL);
-#if defined(TOOLKIT_VIEWS)
- // Open the Find window with animations disabled.
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
browser()->ShowFindBar();
// Our Find bar should be the new target.
@@ -732,10 +714,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, StayActive) {
GURL url = server->TestServerPageW(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
-#if defined(TOOLKIT_VIEWS)
- // Open the Find window with animations disabled.
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
browser()->ShowFindBar();
// Simulate a user clearing the search string. Ideally, we should be
@@ -790,10 +768,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, RestartSearchFromF3) {
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PreferPreviousSearch) {
HTTPTestServer* server = StartHTTPServer();
-#if defined(TOOLKIT_VIEWS)
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
-
// First we navigate to any page.
GURL url = server->TestServerPageW(kSimplePage);
ui_test_utils::NavigateToURL(browser(), url);
@@ -826,10 +800,6 @@ IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, PreferPreviousSearch) {
IN_PROC_BROWSER_TEST_F(FindInPageControllerTest, ActivateLinkNavigatesPage) {
HTTPTestServer* server = StartHTTPServer();
-#if defined(TOOLKIT_VIEWS)
- DropdownBarHost::disable_animations_during_testing_ = true;
-#endif
-
// First we navigate to our test content.
GURL url = server->TestServerPageW(kLinkPage);
ui_test_utils::NavigateToURL(browser(), url);