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

Unified Diff: ash/wm/drag_window_resizer_unittest.cc

Issue 57963003: Enforces 10px visibility when dragging between displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enforces 10px visibility when dragging between displays Created 7 years, 1 month 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 | « ash/wm/dock/docked_window_resizer.cc ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cca570dcfa10e76f78f626cde05f80c60bb5c671 100644
--- a/ash/wm/drag_window_resizer_unittest.cc
+++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -13,6 +13,7 @@
#include "ash/test/cursor_manager_test_api.h"
#include "ash/wm/drag_window_controller.h"
#include "ash/wm/window_util.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/root_window.h"
@@ -191,10 +192,13 @@ 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, 795, 10), 0);
+ // Window should be adjusted for minimum visibility (10px) during the drag.
+ EXPECT_EQ("790,10 50x60", window_->bounds().ToString());
resizer->CompleteDrag(0);
// Since the pointer is still on the primary root window, the parent should
// not be changed.
+ // Window origin should be adjusted for minimum visibility (10px).
EXPECT_EQ(root_windows[0], window_->GetRootWindow());
EXPECT_EQ("790,10 50x60", window_->bounds().ToString());
}
@@ -214,7 +218,10 @@ TEST_F(DragWindowResizerTest, WindowDragWithMultiDisplays) {
// 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());
+ // Window origin should be adjusted for minimum visibility (10px).
+ int expected_x = -50 + 10;
+ EXPECT_EQ(base::IntToString(expected_x) + ",10 50x60",
+ window_->bounds().ToString());
}
}
@@ -280,7 +287,10 @@ 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());
+ // Window origin should be adjusted for minimum visibility (10px).
+ int expected_x = 800 - 10;
+ EXPECT_EQ(base::IntToString(expected_x) + ",0 50x60",
+ window_->bounds().ToString());
}
}
« no previous file with comments | « ash/wm/dock/docked_window_resizer.cc ('k') | ash/wm/window_resizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698