| 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 8dfe19a5036522e259c074938b4ce16f043e7311..89aa51bedc4796a396b651f6b4fb7262448b97ee 100644
|
| --- a/chrome/browser/ui/panels/panel_browsertest.cc
|
| +++ b/chrome/browser/ui/panels/panel_browsertest.cc
|
| @@ -151,7 +151,7 @@ class PanelBrowserTest : public BasePanelBrowserTest {
|
| NativePanelTesting::Create(panels[i]->native_panel());
|
| }
|
|
|
| - // Test minimize.
|
| + // Verify titlebar click does not minimize.
|
| for (size_t index = 0; index < panels.size(); ++index) {
|
| // Press left mouse button. Verify nothing changed.
|
| native_panels_testing[index]->PressLeftMouseButtonTitlebar(
|
| @@ -159,8 +159,15 @@ class PanelBrowserTest : public BasePanelBrowserTest {
|
| EXPECT_EQ(expected_bounds, GetAllPanelBounds());
|
| EXPECT_EQ(expected_expansion_states, GetAllPanelExpansionStates());
|
|
|
| - // Release mouse button. Verify minimized.
|
| + // Release mouse button. Verify nothing changed.
|
| native_panels_testing[index]->ReleaseMouseButtonTitlebar();
|
| + EXPECT_EQ(expected_bounds, GetAllPanelBounds());
|
| + EXPECT_EQ(expected_expansion_states, GetAllPanelExpansionStates());
|
| + }
|
| +
|
| + // Minimize all panels for next stage in test.
|
| + for (size_t index = 0; index < panels.size(); ++index) {
|
| + panels[index]->Minimize();
|
| expected_bounds[index].set_height(Panel::kMinimizedPanelHeight);
|
| expected_bounds[index].set_y(
|
| test_begin_bounds[index].y() +
|
| @@ -1001,9 +1008,6 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest, MAYBE_DrawAttentionResetOnClick) {
|
| panel->Close();
|
| }
|
|
|
| -// There was a bug when it was not possible to minimize the panel by clicking
|
| -// on the titlebar right after it was restored and activated. This test verifies
|
| -// it's possible.
|
| IN_PROC_BROWSER_TEST_F(PanelBrowserTest,
|
| MinimizeImmediatelyAfterRestore) {
|
| CreatePanelParams params("Initially Inactive", gfx::Rect(), SHOW_AS_ACTIVE);
|
| @@ -1011,7 +1015,7 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest,
|
| scoped_ptr<NativePanelTesting> native_panel_testing(
|
| NativePanelTesting::Create(panel->native_panel()));
|
|
|
| - panel->SetExpansionState(Panel::MINIMIZED); // this should deactivate.
|
| + panel->Minimize(); // this should deactivate.
|
| MessageLoop::current()->RunAllPending();
|
| WaitForPanelActiveState(panel, SHOW_AS_INACTIVE);
|
| EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state());
|
| @@ -1021,10 +1025,8 @@ IN_PROC_BROWSER_TEST_F(PanelBrowserTest,
|
| WaitForPanelActiveState(panel, SHOW_AS_ACTIVE);
|
| EXPECT_EQ(Panel::EXPANDED, panel->expansion_state());
|
|
|
| - // Test that click on the titlebar right after expansion minimizes the Panel.
|
| - native_panel_testing->PressLeftMouseButtonTitlebar(
|
| - panel->GetBounds().origin());
|
| - native_panel_testing->ReleaseMouseButtonTitlebar();
|
| + // Verify that minimizing a panel right after expansion works.
|
| + panel->Minimize();
|
| MessageLoop::current()->RunAllPending();
|
| EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state());
|
| panel->Close();
|
|
|