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

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

Issue 9616037: Change panel drag related methods to use mouse location in screen coordinates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to reland Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/panels/native_panel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 24e22c14444ff0bf9cca5c4084c9e1ebbacc5da6..9b64185cab9f90fa97df171626d4bf6ecea8c76b 100644
--- a/chrome/browser/ui/panels/detached_panel_browsertest.cc
+++ b/chrome/browser/ui/panels/detached_panel_browsertest.cc
@@ -55,12 +55,14 @@ 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);
+ WaitForBoundsAnimationFinished(panel);
EXPECT_EQ(origin, panel->GetBounds().origin());
- panel_testing->DragTitlebar(37, -42);
- origin.Offset(37, -42);
+ origin.Offset(37, 45);
+ panel_testing->DragTitlebar(origin);
+ WaitForBoundsAnimationFinished(panel);
EXPECT_EQ(origin, panel->GetBounds().origin());
panel_testing->FinishDragTitlebar();
@@ -74,15 +76,18 @@ 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);
+ WaitForBoundsAnimationFinished(panel);
EXPECT_EQ(origin, panel->GetBounds().origin());
- panel_testing->DragTitlebar(37, -42);
- origin.Offset(37, -42);
+ origin.Offset(37, 45);
+ panel_testing->DragTitlebar(origin);
+ WaitForBoundsAnimationFinished(panel);
EXPECT_EQ(origin, panel->GetBounds().origin());
panel_testing->CancelDragTitlebar();
+ WaitForBoundsAnimationFinished(panel);
EXPECT_EQ(original_position, panel->GetBounds().origin());
panel_manager->CloseAll();
@@ -118,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());
@@ -166,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());
@@ -208,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/native_panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698