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

Unified Diff: ui/views/mus/window_manager_connection_unittest.cc

Issue 2463753003: Changes ScreenMusDelegate::GetWindowAtScreenPoint to return aura::Window (Closed)
Patch Set: Created 4 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 | « ui/views/mus/window_manager_connection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/window_manager_connection_unittest.cc
diff --git a/ui/views/mus/window_manager_connection_unittest.cc b/ui/views/mus/window_manager_connection_unittest.cc
index 40e2858e014b8eb8e3cea77bbd878e4da87171ef..299cb7c0cd84824e9dd35da929fd98310d28406b 100644
--- a/ui/views/mus/window_manager_connection_unittest.cc
+++ b/ui/views/mus/window_manager_connection_unittest.cc
@@ -27,6 +27,11 @@ class WindowManagerConnectionTest : public testing::Test {
ScreenMusDelegate* screen_mus_delegate() { return connection(); }
+ ui::Window* GetWindowAtScreenPoint(const gfx::Point& point) {
+ return test::WindowManagerConnectionTestApi(connection())
+ .GetUiWindowAtScreenPoint(point);
+ }
+
private:
base::MessageLoop message_loop_;
ScopedViewsTestHelper helper_;
@@ -50,8 +55,7 @@ TEST_F(WindowManagerConnectionTest, GetWindowAtScreenPointRecurse) {
two->SetVisible(true);
// Ensure that we recurse down to the second window.
- EXPECT_EQ(two,
- screen_mus_delegate()->GetWindowAtScreenPoint(gfx::Point(50, 50)));
+ EXPECT_EQ(two, GetWindowAtScreenPoint(gfx::Point(50, 50)));
}
TEST_F(WindowManagerConnectionTest, GetWindowAtScreenPointRecurseButIgnore) {
@@ -71,8 +75,7 @@ TEST_F(WindowManagerConnectionTest, GetWindowAtScreenPointRecurseButIgnore) {
// We'll recurse down, but we'll use the parent anyway because the children
// don't match the bounds.
- EXPECT_EQ(one,
- screen_mus_delegate()->GetWindowAtScreenPoint(gfx::Point(50, 50)));
+ EXPECT_EQ(one, GetWindowAtScreenPoint(gfx::Point(50, 50)));
}
TEST_F(WindowManagerConnectionTest, GetWindowAtScreenPointDisplayOffset) {
@@ -90,8 +93,7 @@ TEST_F(WindowManagerConnectionTest, GetWindowAtScreenPointDisplayOffset) {
api.screen()->display_list()->FindDisplayById(displays[0].id())->
set_bounds(gfx::Rect(44, 44, 50, 50));
- EXPECT_EQ(one,
- screen_mus_delegate()->GetWindowAtScreenPoint(gfx::Point(50, 50)));
+ EXPECT_EQ(one, GetWindowAtScreenPoint(gfx::Point(50, 50)));
}
TEST_F(WindowManagerConnectionTest, IgnoresHiddenWindows) {
@@ -105,8 +107,7 @@ TEST_F(WindowManagerConnectionTest, IgnoresHiddenWindows) {
ASSERT_GE(displays.size(), 1u);
ui::WindowPrivate(one).LocalSetDisplay(displays[0].id());
- EXPECT_EQ(nullptr,
- screen_mus_delegate()->GetWindowAtScreenPoint(gfx::Point(50, 50)));
+ EXPECT_EQ(nullptr, GetWindowAtScreenPoint(gfx::Point(50, 50)));
}
} // namespace
« no previous file with comments | « ui/views/mus/window_manager_connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698