Chromium Code Reviews| Index: components/mus/ws/window_manager_client_unittest.cc |
| diff --git a/components/mus/ws/window_manager_client_unittest.cc b/components/mus/ws/window_manager_client_unittest.cc |
| index 1721a4d96473247140b5675fa0db8e57b92dace5..5392d7b744e4b2c2d9273ddd7f28726f3058f140 100644 |
| --- a/components/mus/ws/window_manager_client_unittest.cc |
| +++ b/components/mus/ws/window_manager_client_unittest.cc |
| @@ -12,6 +12,7 @@ |
| #include "components/mus/common/util.h" |
| #include "components/mus/public/cpp/lib/window_private.h" |
| #include "components/mus/public/cpp/tests/window_server_test_base.h" |
| +#include "components/mus/public/cpp/tests/window_tree_client_private.h" |
| #include "components/mus/public/cpp/window_observer.h" |
| #include "components/mus/public/cpp/window_tree_client.h" |
| #include "components/mus/public/cpp/window_tree_client_delegate.h" |
| @@ -757,6 +758,7 @@ TEST_F(WindowServerTest, Focus) { |
| EXPECT_EQ(server_id(window11), server_id(observer.last_gained_focus())); |
| EXPECT_EQ(server_id(GetFirstRoot(embedded)), |
| server_id(observer.last_lost_focus())); |
| + ASSERT_TRUE(WaitForWindowToHaveFocus(window11)); |
|
sadrul
2016/06/15 06:42:46
Why? window11 already has focus (asserted above in
|
| } |
| { |
| @@ -770,7 +772,10 @@ TEST_F(WindowServerTest, Focus) { |
| EXPECT_EQ(server_id(window11), server_id(observer.last_lost_focus())); |
| EXPECT_EQ(server_id(GetFirstRoot(embedded)), |
| server_id(observer.last_gained_focus())); |
| + ASSERT_TRUE(WaitForWindowToHaveFocus(GetFirstRoot(embedded))); |
| } |
| + |
| + WindowTreeClientPrivate(embedded).WaitForInFlightQueue(); |
| } |
| TEST_F(WindowServerTest, ClearFocus) { |
| @@ -810,6 +815,8 @@ TEST_F(WindowServerTest, ClearFocus) { |
| EXPECT_FALSE(window1->HasFocus()); |
| EXPECT_FALSE(window_manager()->GetFocusedWindow()); |
| } |
| + |
| + WindowTreeClientPrivate(embedded).WaitForInFlightQueue(); |
|
sadrul
2016/06/15 06:42:46
I don't think we should require individual tests t
jonross
2016/06/15 14:03:08
Yeah I dislike having certain tests with this. I c
|
| } |
| TEST_F(WindowServerTest, FocusNonFocusableWindow) { |
| @@ -891,6 +898,9 @@ TEST_F(WindowServerTest, Activation) { |
| ValidIndexOf(parent->children(), child1)); |
| EXPECT_GT(ValidIndexOf(parent->children(), child3), |
| ValidIndexOf(parent->children(), child1)); |
| + |
| + WindowTreeClientPrivate(embedded1).WaitForInFlightQueue(); |
| + WindowTreeClientPrivate(embedded2).WaitForInFlightQueue(); |
| } |
| TEST_F(WindowServerTest, ActivationNext) { |