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

Unified Diff: services/ui/ws/window_tree_unittest.cc

Issue 2829733002: mus: Changes SetDisplayRoot() to create actual display (Closed)
Patch Set: feedback Created 3 years, 8 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
« services/ui/ws/window_tree.cc ('K') | « services/ui/ws/window_tree.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree_unittest.cc
diff --git a/services/ui/ws/window_tree_unittest.cc b/services/ui/ws/window_tree_unittest.cc
index 9bea9469b86500500c100a127b5bdff3f42e8091..cc10f3dcc22e45cb1dd81de41a6d7b623e5bb4c9 100644
--- a/services/ui/ws/window_tree_unittest.cc
+++ b/services/ui/ws/window_tree_unittest.cc
@@ -1538,8 +1538,6 @@ TEST_F(WindowTreeManualDisplayTest, ClientCreatesDisplayRoot) {
const bool automatically_create_display_roots = false;
AddWindowManager(window_server(), kTestUserId1,
automatically_create_display_roots);
- const int64_t display_id =
- screen_manager().AddDisplay(MakeDisplay(0, 0, 1024, 768, 1.0f));
WindowManagerState* window_manager_state =
window_server()->GetWindowManagerStateForUser(kTestUserId1);
ASSERT_TRUE(window_manager_state);
@@ -1550,10 +1548,6 @@ TEST_F(WindowTreeManualDisplayTest, ClientCreatesDisplayRoot) {
EXPECT_EQ(1, test_window_manager->connect_count());
EXPECT_EQ(0, test_window_manager->display_added_count());
- // Add another display and make sure WindowManager is not updated.
- screen_manager().AddDisplay(MakeDisplay(0, 0, 1024, 768, 1.0f));
- EXPECT_EQ(0, test_window_manager->display_added_count());
-
// Create a window for the windowmanager and set it as the root.
ClientWindowId display_root_id = BuildClientWindowId(window_manager_tree, 10);
ASSERT_TRUE(window_manager_tree->NewWindow(display_root_id,
@@ -1561,8 +1555,17 @@ TEST_F(WindowTreeManualDisplayTest, ClientCreatesDisplayRoot) {
ServerWindow* display_root =
window_manager_tree->GetWindowByClientId(display_root_id);
ASSERT_TRUE(display_root);
+ display::Display display1 = MakeDisplay(0, 0, 1024, 768, 1.0f);
+ display1.set_id(101);
+
+ mojom::WmViewportMetrics metrics;
+ metrics.bounds_in_pixels = display1.bounds();
+ metrics.device_scale_factor = 1.5;
+ metrics.ui_scale_factor = 2.5;
+ const bool is_primary_display = true;
ASSERT_TRUE(WindowTreeTestApi(window_manager_tree)
- .ProcessSetDisplayRoot(display_id, display_root_id));
+ .ProcessSetDisplayRoot(display1, metrics, is_primary_display,
+ display_root_id));
EXPECT_TRUE(display_root->parent());
EXPECT_TRUE(window_server_delegate()
->last_binding()
@@ -1570,18 +1573,14 @@ TEST_F(WindowTreeManualDisplayTest, ClientCreatesDisplayRoot) {
->tracker()
->changes()
->empty());
- ASSERT_EQ(1u, window_manager_tree->roots().size());
- EXPECT_EQ(display_root, *window_manager_tree->roots().begin());
- ASSERT_EQ(2u, WindowManagerStateTestApi(window_manager_state)
- .window_manager_display_roots()
- .size());
+ EXPECT_EQ(1u, window_manager_tree->roots().size());
// Delete the root, which should delete the WindowManagerDisplayRoot.
EXPECT_TRUE(window_manager_tree->DeleteWindow(display_root_id));
- ASSERT_TRUE(window_manager_tree->roots().empty());
- ASSERT_EQ(1u, WindowManagerStateTestApi(window_manager_state)
- .window_manager_display_roots()
- .size());
+ EXPECT_TRUE(window_manager_tree->roots().empty());
+ EXPECT_TRUE(WindowManagerStateTestApi(window_manager_state)
+ .window_manager_display_roots()
+ .empty());
}
} // namespace test
« services/ui/ws/window_tree.cc ('K') | « services/ui/ws/window_tree.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698