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

Unified Diff: components/mus/ws/window_manager_client_apptest.cc

Issue 1469603003: mus: Fix notifying clients about window reordering. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « components/mus/ws/connection_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_manager_client_apptest.cc
diff --git a/components/mus/ws/window_manager_client_apptest.cc b/components/mus/ws/window_manager_client_apptest.cc
index e38b76347462490fe2b05626ea871bcd786be3e9..7d30584c2e6f419e6f3dc3c09c39dee7d9f81875 100644
--- a/components/mus/ws/window_manager_client_apptest.cc
+++ b/components/mus/ws/window_manager_client_apptest.cc
@@ -417,9 +417,7 @@ TEST_F(WindowServerTest, MultiRoots) {
EXPECT_NE(embedded1, embedded2);
}
-// TODO(alhaad): Currently, the RunLoop gets stuck waiting for order change.
-// Debug and re-enable this.
-TEST_F(WindowServerTest, DISABLED_Reorder) {
+TEST_F(WindowServerTest, Reorder) {
Window* window1 = window_manager()->NewWindow();
window1->SetVisible(true);
window_manager()->GetRoot()->AddChild(window1);
@@ -433,29 +431,48 @@ TEST_F(WindowServerTest, DISABLED_Reorder) {
Window* window12 = embedded->NewWindow();
window12->SetVisible(true);
embedded->GetRoot()->AddChild(window12);
+ ASSERT_TRUE(WaitForTreeSizeToMatch(window1, 3u));
Window* root_in_embedded = embedded->GetRoot();
{
- ASSERT_TRUE(WaitForTreeSizeToMatch(root_in_embedded, 3u));
window11->MoveToFront();
- ASSERT_TRUE(WaitForOrderChange(embedded, root_in_embedded));
-
+ // The |embedded| tree should be updated immediately.
EXPECT_EQ(root_in_embedded->children().front(),
embedded->GetWindowById(window12->id()));
EXPECT_EQ(root_in_embedded->children().back(),
embedded->GetWindowById(window11->id()));
+
+ // The |window_manager()| tree is still not updated.
+ EXPECT_EQ(window1->children().back(),
+ window_manager()->GetWindowById(window12->id()));
+
+ // Wait until |window_manager()| tree is updated.
+ ASSERT_TRUE(WaitForOrderChange(
+ window_manager(), window_manager()->GetWindowById(window11->id())));
+ EXPECT_EQ(window1->children().front(),
+ window_manager()->GetWindowById(window12->id()));
+ EXPECT_EQ(window1->children().back(),
+ window_manager()->GetWindowById(window11->id()));
}
{
window11->MoveToBack();
- ASSERT_TRUE(
- WaitForOrderChange(embedded, embedded->GetWindowById(window11->id())));
-
+ // |embedded| should be updated immediately.
EXPECT_EQ(root_in_embedded->children().front(),
embedded->GetWindowById(window11->id()));
EXPECT_EQ(root_in_embedded->children().back(),
embedded->GetWindowById(window12->id()));
+
+ // |window_manager()| is also eventually updated.
+ EXPECT_EQ(window1->children().back(),
+ window_manager()->GetWindowById(window11->id()));
+ ASSERT_TRUE(WaitForOrderChange(
+ window_manager(), window_manager()->GetWindowById(window11->id())));
+ EXPECT_EQ(window1->children().front(),
+ window_manager()->GetWindowById(window11->id()));
+ EXPECT_EQ(window1->children().back(),
+ window_manager()->GetWindowById(window12->id()));
}
}
« no previous file with comments | « components/mus/ws/connection_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698