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

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

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 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 | « services/ui/ws/window_tree.cc ('k') | services/video_capture/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_tree_client_unittest.cc
diff --git a/services/ui/ws/window_tree_client_unittest.cc b/services/ui/ws/window_tree_client_unittest.cc
index d5051d6086372fe7e875a0e6638706bf2cc95578..1f51607e617e4aed4cd4efe98e7c9810f954c4c6 100644
--- a/services/ui/ws/window_tree_client_unittest.cc
+++ b/services/ui/ws/window_tree_client_unittest.cc
@@ -2173,6 +2173,39 @@ TEST_F(WindowTreeClientTest, SurfaceIdPropagation) {
changes1()->back().surface_id.frame_sink_id().client_id());
}
+// Verifies when an unknown window with a known child is added to a hierarchy
+// the known child is identified in the WindowData.
+TEST_F(WindowTreeClientTest, AddUnknownWindowKnownParent) {
+ const Id window_1_100 = wt_client1()->NewWindow(100);
+ ASSERT_TRUE(window_1_100);
+ ASSERT_TRUE(wt_client1()->AddWindow(root_window_id(), window_1_100));
+
+ // Establish the second client at 1,100.
+ ASSERT_NO_FATAL_FAILURE(EstablishSecondClientWithRoot(window_1_100));
+ const Id window_2_1 = wt_client2()->NewWindow(1000);
+ const Id window_2_2 = wt_client2()->NewWindow(2000);
+ // Add 2_1 to the root, remove 2_1, add 2_1 to 2_2 and then 2_2 to the parent.
+ ASSERT_TRUE(
+ wt_client2()->AddWindow(wt_client2()->root_window_id(), window_2_1));
+ ASSERT_TRUE(wt_client2()->RemoveWindowFromParent(window_2_1));
+ ASSERT_TRUE(wt_client2()->AddWindow(window_2_2, window_2_1));
+ wt_client1()->WaitForChangeCount(2);
+ changes1()->clear();
+ ASSERT_TRUE(
+ wt_client2()->AddWindow(wt_client2()->root_window_id(), window_2_2));
+ wt_client1()->WaitForChangeCount(1);
+ const Id window_2_1_in_wm = BuildWindowId(client_id_2(), 1);
+ const Id window_2_2_in_wm = BuildWindowId(client_id_2(), 2);
+ EXPECT_EQ("HierarchyChanged window=" + IdToString(window_2_2_in_wm) +
+ " old_parent=null new_parent=" + IdToString(window_1_100),
+ SingleChangeToDescription(*changes1()));
+ EXPECT_EQ("[window=" + IdToString(window_2_2_in_wm) + " parent=" +
+ IdToString(window_1_100) + "],[window=" +
+ IdToString(window_2_1_in_wm) + " parent=" +
+ IdToString(window_2_2_in_wm) + "]",
+ ChangeWindowDescription(*changes1()));
+}
+
// TODO(sky): need to better track changes to initial client. For example,
// that SetBounsdWindows/AddWindow and the like don't result in messages to the
// originating client.
« no previous file with comments | « services/ui/ws/window_tree.cc ('k') | services/video_capture/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698