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

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

Issue 2029743002: Check WindowTreeClient for empty inflight queue upon teardown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More tests Created 4 years, 6 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
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) {
« components/mus/public/cpp/tests/window_tree_client_unittest.cc ('K') | « components/mus/ws/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698