Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 7981012: Add Mouse hover behavior to Mac Panels when minimized (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cr feedback Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_browsertest.cc
diff --git a/chrome/browser/ui/panels/panel_browsertest.cc b/chrome/browser/ui/panels/panel_browsertest.cc
index f3b29b193ffeac3315a3340a5c6abf78da9e0421..5a7af93fd42b4fd68bb6827bec2905bf48d4b85a 100644
--- a/chrome/browser/ui/panels/panel_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_browsertest.cc
@@ -304,6 +304,12 @@ class PanelBrowserTest : public BasePanelBrowserTest {
}
void TestMinimizeRestore() {
+ // This constant is used to generate a point 'sufficiently higher then
+ // top edge of the panel'. On some platforms (Mac) we extend hover area
+ // a bit above the minimized panel as well, so it takes significant
+ // distance to 'move mouse out' of the hover-sensitive area.
+ const int kFarEnoughFromHoverArea = 153;
+
std::vector<Panel*> panels = PanelManager::GetInstance()->panels();
std::vector<gfx::Rect> test_begin_bounds = GetAllPanelsBounds();
std::vector<gfx::Rect> expected_bounds = test_begin_bounds;
@@ -365,7 +371,8 @@ class PanelBrowserTest : public BasePanelBrowserTest {
CheckExpansionStates(titlebar_exposed_states);
// Hover mouse above the panel. Verify all panels are minimized.
- hover_point.set_y(panels[index]->GetRestoredBounds().y() - 10);
+ hover_point.set_y(
+ panels[index]->GetRestoredBounds().y() - kFarEnoughFromHoverArea);
native_panels_testing[index]->SetMousePositionForMinimizeRestore(
hover_point);
CheckPanelBounds(panels, minimized_bounds);
@@ -389,7 +396,8 @@ class PanelBrowserTest : public BasePanelBrowserTest {
CheckExpansionStates(titlebar_exposed_states);
// Hover mouse above panel. Verify all panels are minimized.
- hover_point.set_y(panels[index]->GetRestoredBounds().y() - 10);
+ hover_point.set_y(
+ panels[index]->GetRestoredBounds().y() - kFarEnoughFromHoverArea);
native_panels_testing[index]->SetMousePositionForMinimizeRestore(
hover_point);
CheckPanelBounds(panels, minimized_bounds);
@@ -814,7 +822,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, AutoResize) {
panel->Close();
}
-#if defined(TOOLKIT_GTK)
+#if defined(TOOLKIT_GTK) || defined(OS_MACOSX)
#define MAYBE_MinimizeRestore MinimizeRestore
#else
#define MAYBE_MinimizeRestore DISABLED_MinimizeRestore

Powered by Google App Engine
This is Rietveld 408576698