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

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

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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/detached_panel_browsertest.cc
diff --git a/chrome/browser/ui/panels/detached_panel_browsertest.cc b/chrome/browser/ui/panels/detached_panel_browsertest.cc
index b2b5e1b1b8317b70c6aa22805aceb0dabda12b60..3867adb12991e2cf3728e25745522f5522a33431 100644
--- a/chrome/browser/ui/panels/detached_panel_browsertest.cc
+++ b/chrome/browser/ui/panels/detached_panel_browsertest.cc
@@ -51,6 +51,8 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, DragDetachedPanel) {
panel->MoveToStrip(detached_strip);
// Test that the detached panel can be dragged anywhere.
+ // Note that we should not drag the panel close to the bottom area to trigger
+ // the attach.
scoped_ptr<NativePanelTesting> panel_testing(
NativePanelTesting::Create(panel->native_panel()));
gfx::Point origin = panel->GetBounds().origin();
@@ -58,12 +60,12 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, DragDetachedPanel) {
panel_testing->PressLeftMouseButtonTitlebar(origin);
EXPECT_EQ(origin, panel->GetBounds().origin());
- panel_testing->DragTitlebar(-51, 102);
- origin.Offset(-51, 102);
+ origin.Offset(-51, -102);
+ panel_testing->DragTitlebar(origin);
EXPECT_EQ(origin, panel->GetBounds().origin());
- panel_testing->DragTitlebar(37, -42);
- origin.Offset(37, -42);
+ origin.Offset(37, 45);
+ panel_testing->DragTitlebar(origin);
EXPECT_EQ(origin, panel->GetBounds().origin());
panel_testing->FinishDragTitlebar();
@@ -77,12 +79,12 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, DragDetachedPanel) {
panel_testing->PressLeftMouseButtonTitlebar(origin);
EXPECT_EQ(origin, panel->GetBounds().origin());
- panel_testing->DragTitlebar(-51, 102);
- origin.Offset(-51, 102);
+ origin.Offset(-51, -102);
+ panel_testing->DragTitlebar(origin);
EXPECT_EQ(origin, panel->GetBounds().origin());
- panel_testing->DragTitlebar(37, -42);
- origin.Offset(37, -42);
+ origin.Offset(37, 45);
+ panel_testing->DragTitlebar(origin);
EXPECT_EQ(origin, panel->GetBounds().origin());
panel_testing->CancelDragTitlebar();
@@ -121,7 +123,7 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, CloseDetachedPanelOnDrag) {
// Start dragging a panel.
panel1_testing->PressLeftMouseButtonTitlebar(panel1->GetBounds().origin());
- panel1_testing->DragTitlebar(-51, -102);
+ panel1_testing->DragTitlebar(panel1_new_position);
EXPECT_TRUE(drag_controller->IsDragging());
EXPECT_EQ(panel1, drag_controller->dragging_panel());
@@ -169,7 +171,7 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, CloseDetachedPanelOnDrag) {
// Start dragging a panel.
panel1_testing->PressLeftMouseButtonTitlebar(panel1->GetBounds().origin());
- panel1_testing->DragTitlebar(-51, -102);
+ panel1_testing->DragTitlebar(panel1_new_position);
EXPECT_TRUE(drag_controller->IsDragging());
EXPECT_EQ(panel1, drag_controller->dragging_panel());
@@ -211,7 +213,7 @@ IN_PROC_BROWSER_TEST_F(DetachedPanelBrowserTest, CloseDetachedPanelOnDrag) {
// Start dragging a panel again.
panel1_testing->PressLeftMouseButtonTitlebar(panel1->GetBounds().origin());
- panel1_testing->DragTitlebar(-51, -102);
+ panel1_testing->DragTitlebar(panel1_new_position);
EXPECT_TRUE(drag_controller->IsDragging());
EXPECT_EQ(panel1, drag_controller->dragging_panel());
« no previous file with comments | « no previous file | chrome/browser/ui/panels/detached_panel_strip.h » ('j') | chrome/browser/ui/panels/docked_panel_strip.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698