summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:35:24 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 22:35:24 +0000
commit855c0147eec8289ad854d2d64a6752a77e79859f (patch)
tree775255fce2539c2e92cd54d5b158967d063123b9
parent0b303cc493d3557b5a5e9e5c8dfc6bdc4953ee73 (diff)
downloadchromium_src-855c0147eec8289ad854d2d64a6752a77e79859f.zip
chromium_src-855c0147eec8289ad854d2d64a6752a77e79859f.tar.gz
chromium_src-855c0147eec8289ad854d2d64a6752a77e79859f.tar.bz2
Linux: Enable FindInPage automated ui test test.
BUG=none TEST=run it Review URL: http://codereview.chromium.org/243010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27423 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/automation/automation_provider.cc7
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc9
-rw-r--r--chrome/browser/views/find_bar_host.cc12
-rw-r--r--chrome/test/automated_ui_tests/automated_ui_test_test.cc9
4 files changed, 25 insertions, 12 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index b4fc56d..cdb7b6d 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -1117,13 +1117,12 @@ void AutomationProvider::HandleOpenFindInPageRequest(
}
void AutomationProvider::GetFindWindowVisibility(int handle, bool* visible) {
- gfx::Point position;
*visible = false;
- if (browser_tracker_->ContainsHandle(handle)) {
- Browser* browser = browser_tracker_->GetResource(handle);
+ Browser* browser = browser_tracker_->GetResource(handle);
+ if (browser) {
FindBarTesting* find_bar =
browser->find_bar()->find_bar()->GetFindBarTesting();
- find_bar->GetFindBarWindowInfo(&position, visible);
+ find_bar->GetFindBarWindowInfo(NULL, visible);
}
}
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index 19d8a46..282dd56 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -532,8 +532,13 @@ void FindBarGtk::Observe(NotificationType type,
bool FindBarGtk::GetFindBarWindowInfo(gfx::Point* position,
bool* fully_visible) {
- NOTIMPLEMENTED();
- return false;
+ if (position)
+ NOTIMPLEMENTED();
+ if (fully_visible) {
+ *fully_visible = !slide_widget_->IsAnimating() &&
+ slide_widget_->IsShowing();
+ }
+ return true;
}
void FindBarGtk::FindEntryTextInContents(bool forward_search) {
diff --git a/chrome/browser/views/find_bar_host.cc b/chrome/browser/views/find_bar_host.cc
index d81d6c1..2d8c27b 100644
--- a/chrome/browser/views/find_bar_host.cc
+++ b/chrome/browser/views/find_bar_host.cc
@@ -242,15 +242,19 @@ bool FindBarHost::GetFindBarWindowInfo(gfx::Point* position,
false) {
// TODO(sky): figure out linux side.
#endif
- *position = gfx::Point();
- *fully_visible = false;
+ if (position)
+ *position = gfx::Point();
+ if (fully_visible)
+ *fully_visible = false;
return false;
}
gfx::Rect window_rect;
host_->GetBounds(&window_rect, true);
- *position = window_rect.origin();
- *fully_visible = host_->IsVisible() && !IsAnimating();
+ if (position)
+ *position = window_rect.origin();
+ if (fully_visible)
+ *fully_visible = host_->IsVisible() && !IsAnimating();
return true;
}
diff --git a/chrome/test/automated_ui_tests/automated_ui_test_test.cc b/chrome/test/automated_ui_tests/automated_ui_test_test.cc
index a78c446..8c6758f 100644
--- a/chrome/test/automated_ui_tests/automated_ui_test_test.cc
+++ b/chrome/test/automated_ui_tests/automated_ui_test_test.cc
@@ -36,13 +36,18 @@
// Automation pieces are not implemented for these on platforms other than
// Windows.
#if defined(OS_WIN)
-#define MAYBE_FindInPage FindInPage
#define MAYBE_ShowBookmarkBar ShowBookmarkBar
#else
-#define MAYBE_FindInPage DISABLED_FindInPage
#define MAYBE_ShowBookmarkBar DISABLED_ShowBookmarkBar
#endif
+// FindBarTesting not implemented on mac.
+#if defined(OS_MACOSX)
+#define MAYBE_FindInPage DISABLED_FindInPage
+#else
+#define MAYBE_FindInPage FindInPage
+#endif
+
TEST_F(AutomatedUITestBase, MAYBE_FindInPage) {
ASSERT_TRUE(FindInPage());
bool is_visible;