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

Side by Side Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 10828220: Fix Linux panels to return to minimized mode after mouse moves away. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update DragMinimizedPanelWhileDrawingAttention Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/browser/download/download_service.h" 7 #include "chrome/browser/download/download_service.h"
8 #include "chrome/browser/download/download_service_factory.h" 8 #include "chrome/browser/download/download_service_factory.h"
9 #include "chrome/browser/net/url_request_mock_util.h" 9 #include "chrome/browser/net/url_request_mock_util.h"
10 #include "chrome/browser/prefs/browser_prefs.h" 10 #include "chrome/browser/prefs/browser_prefs.h"
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); 1157 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
1158 1158
1159 gfx::Point hover_point_in_panel(panel1->GetBounds().origin()); 1159 gfx::Point hover_point_in_panel(panel1->GetBounds().origin());
1160 MoveMouse(hover_point_in_panel); 1160 MoveMouse(hover_point_in_panel);
1161 1161
1162 panel1->FlashFrame(false); 1162 panel1->FlashFrame(false);
1163 EXPECT_FALSE(panel1->IsDrawingAttention()); 1163 EXPECT_FALSE(panel1->IsDrawingAttention());
1164 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state()); 1164 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
1165 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); 1165 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state());
1166 1166
1167 // Move mouse away and panel should go back to fully minimized state. 1167 // Typical user scenario will detect the mouse in the panel
1168 // after attention is cleared, causing titles to pop up, so
1169 // we simulate that here.
1170 MoveMouseAndWaitForExpansionStateChange(panel2, hover_point_in_panel);
1171 EXPECT_EQ(Panel::TITLE_ONLY, panel1->expansion_state());
1172 EXPECT_EQ(Panel::TITLE_ONLY, panel2->expansion_state());
1173
1174 // Move mouse away and panels should go back to fully minimized state.
1168 MoveMouseAndWaitForExpansionStateChange(panel1, hover_point); 1175 MoveMouseAndWaitForExpansionStateChange(panel1, hover_point);
1169 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state()); 1176 EXPECT_EQ(Panel::MINIMIZED, panel1->expansion_state());
1170 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state()); 1177 EXPECT_EQ(Panel::MINIMIZED, panel2->expansion_state());
1171 1178
1172 panel1->Close(); 1179 panel1->Close();
1173 panel2->Close(); 1180 panel2->Close();
1174 } 1181 }
1175 1182
1176 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DrawAttentionWhenActive) { 1183 IN_PROC_BROWSER_TEST_F(PanelBrowserTest, DrawAttentionWhenActive) {
1177 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE); 1184 CreatePanelParams params("Initially Active", gfx::Rect(), SHOW_AS_ACTIVE);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 EXPECT_GT(old_full_size.width(), panel->full_size().width()); 1579 EXPECT_GT(old_full_size.width(), panel->full_size().width());
1573 EXPECT_GT(old_full_size.height(), panel->full_size().height()); 1580 EXPECT_GT(old_full_size.height(), panel->full_size().height());
1574 EXPECT_GE(panel->max_size().width(), panel->full_size().width()); 1581 EXPECT_GE(panel->max_size().width(), panel->full_size().width());
1575 EXPECT_GE(panel->max_size().height(), panel->full_size().height()); 1582 EXPECT_GE(panel->max_size().height(), panel->full_size().height());
1576 EXPECT_EQ(smaller_work_area_size.height(), panel->full_size().height()); 1583 EXPECT_EQ(smaller_work_area_size.height(), panel->full_size().height());
1577 1584
1578 panel->Close(); 1585 panel->Close();
1579 } 1586 }
1580 1587
1581 #endif // OS_WIN || OS_MACOSX 1588 #endif // OS_WIN || OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/old_panel_drag_browsertest.cc ('k') | chrome/browser/ui/panels/panel_drag_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698