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

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

Issue 8341098: Mac: Added a delay before panels go to minimized state from title-only state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cr feedback Created 9 years, 2 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 379527770f19c13fea93e27e28efc24c36024723..296df08cc8766b6ba0e9f534f38761b238d2ba5b 100644
--- a/chrome/browser/ui/panels/panel_browsertest.cc
+++ b/chrome/browser/ui/panels/panel_browsertest.cc
@@ -52,6 +52,15 @@ class PanelBrowserTest : public BasePanelBrowserTest {
MessageLoopForUI::current()->RunAllPending();
}
+ void MoveMouseAndWiatForExpansionStateChange(Panel* panel,
jianli 2011/10/28 21:31:33 Wiat => Wait
Dmitry Titov 2011/10/29 00:04:56 Done.
+ gfx::Point position) {
jianli 2011/10/28 21:31:33 const gfx::Point&
+ ui_test_utils::WindowedNotificationObserver signal(
+ chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE,
+ content::Source<Panel>(panel));
+ MoveMouse(position);
+ signal.Wait();
+ }
+
void TestCreatePanelOnOverflow() {
PanelManager* panel_manager = PanelManager::GetInstance();
EXPECT_EQ(0, panel_manager->num_panels()); // No panels initially.
@@ -398,14 +407,14 @@ class PanelBrowserTest : public BasePanelBrowserTest {
// Hover mouse on minimized panel.
// Verify titlebar is exposed on all panels.
gfx::Point hover_point(panels[index]->GetBounds().origin());
- MoveMouse(hover_point);
+ MoveMouseAndWiatForExpansionStateChange(panels[index], hover_point);
EXPECT_EQ(titlebar_exposed_bounds, GetAllPanelBounds());
EXPECT_EQ(titlebar_exposed_states, GetAllPanelExpansionStates());
// Hover mouse above the panel. Verify all panels are minimized.
hover_point.set_y(
panels[index]->GetBounds().y() - kFarEnoughFromHoverArea);
- MoveMouse(hover_point);
+ MoveMouseAndWiatForExpansionStateChange(panels[index], hover_point);
EXPECT_EQ(minimized_bounds, GetAllPanelBounds());
EXPECT_EQ(minimized_states, GetAllPanelExpansionStates());
@@ -413,7 +422,7 @@ class PanelBrowserTest : public BasePanelBrowserTest {
// Verify titlebar is exposed on all panels.
hover_point.set_y(panels[index]->GetBounds().y() +
panels[index]->GetBounds().height() + 5);
- MoveMouse(hover_point);
+ MoveMouseAndWiatForExpansionStateChange(panels[index], hover_point);
EXPECT_EQ(titlebar_exposed_bounds, GetAllPanelBounds());
EXPECT_EQ(titlebar_exposed_states, GetAllPanelExpansionStates());
@@ -427,7 +436,7 @@ class PanelBrowserTest : public BasePanelBrowserTest {
// Hover mouse above panel. Verify all panels are minimized.
hover_point.set_y(
panels[index]->GetBounds().y() - kFarEnoughFromHoverArea);
- MoveMouse(hover_point);
+ MoveMouseAndWiatForExpansionStateChange(panels[index], hover_point);
EXPECT_EQ(minimized_bounds, GetAllPanelBounds());
EXPECT_EQ(minimized_states, GetAllPanelExpansionStates());
}

Powered by Google App Engine
This is Rietveld 408576698