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

Unified Diff: components/mus/public/cpp/tests/window_tree_client_private.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/public/cpp/tests/window_tree_client_private.cc
diff --git a/components/mus/public/cpp/tests/window_tree_client_private.cc b/components/mus/public/cpp/tests/window_tree_client_private.cc
index 3d2e2bd5e92dfc1d2bb52ca73348ca4057bbaf50..cb923d4aa06afb8d1cf8b131e38f1f6c27d7ea20 100644
--- a/components/mus/public/cpp/tests/window_tree_client_private.cc
+++ b/components/mus/public/cpp/tests/window_tree_client_private.cc
@@ -4,6 +4,8 @@
#include "components/mus/public/cpp/tests/window_tree_client_private.h"
+#include "base/run_loop.h"
+#include "components/mus/public/cpp/lib/in_flight_change.h"
#include "components/mus/public/cpp/window.h"
#include "components/mus/public/cpp/window_tree_client.h"
@@ -43,4 +45,15 @@ void WindowTreeClientPrivate::CallOnWindowInputEvent(
std::move(event), observer_id);
}
+void WindowTreeClientPrivate::ClearInFlightQueue() {
+ tree_client_impl_->in_flight_map_.clear();
+}
+
+void WindowTreeClientPrivate::WaitForInFlightQueue() {
+ while (!tree_client_impl_->in_flight_map_.empty()) {
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
+ }
+}
+
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698