Chromium Code Reviews| Index: ash/wm/drag_window_resizer_unittest.cc |
| diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc |
| index 844cbaa57a53eb3843af1ce7ce3cd70385f589c8..b3542943e33b3b3588089285d65c3fee2398b141 100644 |
| --- a/ash/wm/drag_window_resizer_unittest.cc |
| +++ b/ash/wm/drag_window_resizer_unittest.cc |
| @@ -165,7 +165,7 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplays) { |
| Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| ASSERT_EQ(2U, root_windows.size()); |
| - window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| + window_->SetBoundsInScreen(gfx::Rect(0, 0, 100, 60), |
|
flackr
2013/11/01 16:52:28
Maybe add a comment w.r.t. why you need the bounds
varkha
2013/11/05 20:34:23
Moved to https://codereview.chromium.org/57963003/
|
| Shell::GetScreen()->GetPrimaryDisplay()); |
| EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| { |
| @@ -180,10 +180,10 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplays) { |
| // The whole window is on the secondary display now. The parent should be |
| // changed. |
| EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| - EXPECT_EQ("0,10 50x60", window_->bounds().ToString()); |
| + EXPECT_EQ("0,10 100x60", window_->bounds().ToString()); |
| } |
| - window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| + window_->SetBoundsInScreen(gfx::Rect(0, 0, 100, 60), |
| Shell::GetScreen()->GetPrimaryDisplay()); |
| EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| { |
| @@ -191,30 +191,30 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplays) { |
| scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer( |
| window_.get(), gfx::Point(), HTCAPTION)); |
| ASSERT_TRUE(resizer.get()); |
| - resizer->Drag(CalculateDragPoint(*resizer, 790, 10), 0); |
| + resizer->Drag(CalculateDragPoint(*resizer, 768, 10), 0); |
| resizer->CompleteDrag(0); |
| // Since the pointer is still on the primary root window, the parent should |
| // not be changed. |
| EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| - EXPECT_EQ("790,10 50x60", window_->bounds().ToString()); |
| + EXPECT_EQ("768,10 100x60", window_->bounds().ToString()); |
| } |
| - window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| + window_->SetBoundsInScreen(gfx::Rect(0, 0, 100, 60), |
| Shell::GetScreen()->GetPrimaryDisplay()); |
| EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| { |
| // Grab the top-right edge of the window and move the pointer to (0, 10) |
| // in the secondary root window's coordinates. |
| scoped_ptr<WindowResizer> resizer(CreateDragWindowResizer( |
| - window_.get(), gfx::Point(49, 0), HTCAPTION)); |
| + window_.get(), gfx::Point(99, 0), HTCAPTION)); |
| ASSERT_TRUE(resizer.get()); |
| - resizer->Drag(CalculateDragPoint(*resizer, 751, 10), ui::EF_CONTROL_DOWN); |
| + resizer->Drag(CalculateDragPoint(*resizer, 731, 10), ui::EF_CONTROL_DOWN); |
| resizer->CompleteDrag(0); |
| // Since the pointer is on the secondary, the parent should be changed |
| // even though only small fraction of the window is within the secondary |
| // root window's bounds. |
| EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| - EXPECT_EQ("-49,10 50x60", window_->bounds().ToString()); |
| + EXPECT_EQ("-69,10 100x60", window_->bounds().ToString()); |
| } |
| } |
| @@ -280,7 +280,8 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplaysRightToLeft) { |
| resizer->Drag(CalculateDragPoint(*resizer, -2, 0), ui::EF_CONTROL_DOWN); |
| resizer->CompleteDrag(0); |
| EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| - EXPECT_EQ("798,0 50x60", window_->bounds().ToString()); |
| + gfx::Rect expected_bounds = gfx::Rect(800 - 50 * 0.3, 0, 50, 60); |
| + EXPECT_EQ(expected_bounds.ToString(), window_->bounds().ToString()); |
| } |
| } |
| @@ -293,7 +294,7 @@ TEST_F(DragWindowResizerTest, DragWindowController) { |
| Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| ASSERT_EQ(2U, root_windows.size()); |
| - window_->SetBoundsInScreen(gfx::Rect(0, 0, 50, 60), |
| + window_->SetBoundsInScreen(gfx::Rect(0, 0, 100, 60), |
| Shell::GetScreen()->GetPrimaryDisplay()); |
| EXPECT_EQ(root_windows[0], window_->GetRootWindow()); |
| EXPECT_FLOAT_EQ(1.0f, window_->layer()->opacity()); |
| @@ -442,7 +443,7 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) { |
| window_.get(), gfx::Point(), HTCAPTION)); |
| EXPECT_EQ(1.0f, cursor_test_api.GetDisplay().device_scale_factor()); |
| ASSERT_TRUE(resizer.get()); |
| - resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); |
| + resizer->Drag(CalculateDragPoint(*resizer, 400, 200), 0); |
| WarpMouseCursorIfNecessary(root_windows[0], gfx::Point(399, 200)); |
| EXPECT_EQ(2.0f, cursor_test_api.GetDisplay().device_scale_factor()); |
| resizer->CompleteDrag(0); |
| @@ -453,7 +454,7 @@ TEST_F(DragWindowResizerTest, CursorDeviceScaleFactor) { |
| // window with 1.0 device scale factor. |
| { |
| window_->SetBoundsInScreen( |
| - gfx::Rect(600, 0, 50, 60), |
| + gfx::Rect(600, 0, 100, 60), |
| Shell::GetScreen()->GetDisplayNearestWindow(root_windows[1])); |
| EXPECT_EQ(root_windows[1], window_->GetRootWindow()); |
| // Grab (0, 0) of the window. |