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

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

Issue 10106008: Change Panel titlebars to activate the panel on click (rather than minimize). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GTK changes Created 8 years, 8 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 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();

Powered by Google App Engine
This is Rietveld 408576698