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

Unified Diff: ui/aura/mus/window_tree_client_unittest.cc

Issue 2535983004: Makes sure bounds and visibilty are updated correctly for new displays (Closed)
Patch Set: merge Created 4 years 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/aura/mus/window_tree_client.cc ('k') | ui/aura/test/aura_test_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/window_tree_client_unittest.cc
diff --git a/ui/aura/mus/window_tree_client_unittest.cc b/ui/aura/mus/window_tree_client_unittest.cc
index d79db8f5518fdf2b316b6466f6a6e53a35fbfd86..8daf7288b383ddbea6cc3685affab72c6c15c5d8 100644
--- a/ui/aura/mus/window_tree_client_unittest.cc
+++ b/ui/aura/mus/window_tree_client_unittest.cc
@@ -1341,4 +1341,27 @@ TEST_F(WindowTreeClientClientTest, OnWindowDeletedDoesntNotifyServer) {
EXPECT_FALSE(window_tree()->has_change());
}
+TEST_F(WindowTreeClientWmTest, NewWindowTreeHostIsConfiguredCorrectly) {
+ display::Display display(201);
+ display.set_bounds(gfx::Rect(1, 2, 101, 102));
+
+ ui::mojom::WindowDataPtr root_data(ui::mojom::WindowData::New());
+ root_data->parent_id = 0;
+ root_data->window_id = 101;
+ root_data->visible = true;
+ root_data->bounds = display.bounds();
+ const bool parent_drawn = true;
+
+ // AuraTestBase ends up owning WindowTreeHost.
+ WindowTreeHostMus* window_tree_host =
+ WindowTreeClientPrivate(window_tree_client_impl())
+ .CallWmNewDisplayAdded(display, std::move(root_data), parent_drawn);
+ EXPECT_EQ(display.bounds(), window_tree_host->GetBoundsInPixels());
+ // The root window of the WindowTreeHost always has an origin of 0,0.
+ EXPECT_EQ(gfx::Rect(display.bounds().size()),
+ window_tree_host->window()->bounds());
+ EXPECT_TRUE(window_tree_host->window()->IsVisible());
+ EXPECT_EQ(display.id(), window_tree_host->display_id());
+}
+
} // namespace aura
« no previous file with comments | « ui/aura/mus/window_tree_client.cc ('k') | ui/aura/test/aura_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698