OLD | NEW |
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/old_base_panel_browser_test.h" | 6 #include "chrome/browser/ui/panels/old_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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 mouse_location.Offset(-70, 0); | 473 mouse_location.Offset(-70, 0); |
474 panel_testing->DragTitlebar(mouse_location); | 474 panel_testing->DragTitlebar(mouse_location); |
475 gfx::Rect panel_new_bounds = panel_old_bounds; | 475 gfx::Rect panel_new_bounds = panel_old_bounds; |
476 panel_new_bounds.Offset(-70, 0); | 476 panel_new_bounds.Offset(-70, 0); |
477 EXPECT_EQ(panel_new_bounds, panel->GetBounds()); | 477 EXPECT_EQ(panel_new_bounds, panel->GetBounds()); |
478 | 478 |
479 panel->FlashFrame(false); | 479 panel->FlashFrame(false); |
480 EXPECT_FALSE(panel->IsDrawingAttention()); | 480 EXPECT_FALSE(panel->IsDrawingAttention()); |
481 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); | 481 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); |
482 | 482 |
| 483 // Typical user scenario will detect the mouse in the panel |
| 484 // after attention is cleared, causing titles to pop up, so |
| 485 // we simulate that here. |
| 486 MoveMouse(mouse_location); |
| 487 |
483 // Verify panel returns to fully minimized state after dragging ends once | 488 // Verify panel returns to fully minimized state after dragging ends once |
484 // mouse moves away from the panel. | 489 // mouse moves away from the panel. |
485 panel_testing->FinishDragTitlebar(); | 490 panel_testing->FinishDragTitlebar(); |
486 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); | 491 EXPECT_EQ(Panel::TITLE_ONLY, panel->expansion_state()); |
487 | 492 |
488 mouse_location.Offset(0, -50); | 493 mouse_location.Offset(0, -50); |
489 MoveMouseAndWaitForExpansionStateChange(panel, mouse_location); | 494 MoveMouseAndWaitForExpansionStateChange(panel, mouse_location); |
490 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); | 495 EXPECT_EQ(Panel::MINIMIZED, panel->expansion_state()); |
491 | 496 |
492 PanelManager::GetInstance()->CloseAll(); | 497 PanelManager::GetInstance()->CloseAll(); |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 | 1346 |
1342 // Drag down the panel. Expect that the panel can be dragged without | 1347 // Drag down the panel. Expect that the panel can be dragged without |
1343 // constraint. | 1348 // constraint. |
1344 drag_to_location = gfx::Point(280, 150); | 1349 drag_to_location = gfx::Point(280, 150); |
1345 DragPanelToMouseLocation(panel, drag_to_location); | 1350 DragPanelToMouseLocation(panel, drag_to_location); |
1346 EXPECT_EQ(PanelStrip::DETACHED, panel->panel_strip()->type()); | 1351 EXPECT_EQ(PanelStrip::DETACHED, panel->panel_strip()->type()); |
1347 EXPECT_EQ(drag_to_location, panel->GetBounds().origin()); | 1352 EXPECT_EQ(drag_to_location, panel->GetBounds().origin()); |
1348 | 1353 |
1349 panel_manager->CloseAll(); | 1354 panel_manager->CloseAll(); |
1350 } | 1355 } |
OLD | NEW |