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

Side by Side Diff: chrome/browser/ui/panels/panel_drag_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
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 5 #include "base/message_loop.h"
6 #include "chrome/browser/ui/panels/base_panel_browser_test.h" 6 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
7 #include "chrome/browser/ui/panels/detached_panel_strip.h" 7 #include "chrome/browser/ui/panels/detached_panel_strip.h"
8 #include "chrome/browser/ui/panels/docked_panel_strip.h" 8 #include "chrome/browser/ui/panels/docked_panel_strip.h"
9 #include "chrome/browser/ui/panels/native_panel.h" 9 #include "chrome/browser/ui/panels/native_panel.h"
10 #include "chrome/browser/ui/panels/panel.h" 10 #include "chrome/browser/ui/panels/panel.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 mouse_location.Offset(-70, 0); 476 mouse_location.Offset(-70, 0);
477 panel_testing->DragTitlebar(mouse_location); 477 panel_testing->DragTitlebar(mouse_location);
478 gfx::Rect panel_new_bounds = panel_old_bounds; 478 gfx::Rect panel_new_bounds = panel_old_bounds;
479 panel_new_bounds.Offset(-70, 0); 479 panel_new_bounds.Offset(-70, 0);
480 EXPECT_EQ(panel_new_bounds, panel->GetBounds()); 480 EXPECT_EQ(panel_new_bounds, panel->GetBounds());
481 481
482 panel->FlashFrame(false); 482 panel->FlashFrame(false);
483 EXPECT_FALSE(panel->IsDrawingAttention()); 483 EXPECT_FALSE(panel->IsDrawingAttention());
484 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); 484 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state());
485 485
486 // Typical user scenario will detect the mouse in the panel
487 // after attention is cleared, causing titles to pop up, so
488 // we simulate that here.
489 MoveMouse(mouse_location);
490
486 // Verify panel returns to fully minimized state after dragging ends once 491 // Verify panel returns to fully minimized state after dragging ends once
487 // mouse moves away from the panel. 492 // mouse moves away from the panel.
488 panel_testing->FinishDragTitlebar(); 493 panel_testing->FinishDragTitlebar();
489 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); 494 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state());
490 495
491 mouse_location.Offset(0, -50); 496 mouse_location.Offset(0, -50);
492 MoveMouseAndWaitForExpansionStateChange(panel, mouse_location); 497 MoveMouseAndWaitForExpansionStateChange(panel, mouse_location);
493 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); 498 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state());
494 499
495 PanelManager::GetInstance()->CloseAll(); 500 PanelManager::GetInstance()->CloseAll();
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 // constraint. 1344 // constraint.
1340 drag_to_location = gfx::Point(280, 150); 1345 drag_to_location = gfx::Point(280, 150);
1341 DragPanelToMouseLocation(panel, drag_to_location); 1346 DragPanelToMouseLocation(panel, drag_to_location);
1342 EXPECT_EQ(PanelStrip::DETACHED, panel->panel_strip()->type()); 1347 EXPECT_EQ(PanelStrip::DETACHED, panel->panel_strip()->type());
1343 EXPECT_EQ(drag_to_location, panel->GetBounds().origin()); 1348 EXPECT_EQ(drag_to_location, panel->GetBounds().origin());
1344 1349
1345 panel_manager->CloseAll(); 1350 panel_manager->CloseAll();
1346 } 1351 }
1347 1352
1348 #endif // OS_WIN || OS_MACOSX 1353 #endif // OS_WIN || OS_MACOSX
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698