Chromium Code Reviews| 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()); |
| } |