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

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

Issue 2352893002: Makes windowserver not send messages during shutdown (Closed)
Patch Set: merge Created 4 years, 3 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
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/test_utils.cc
diff --git a/services/ui/ws/test_utils.cc b/services/ui/ws/test_utils.cc
index 8f86857b64ef884b24b089087f6b90c6dea272ae..e60c7c1595343402944ab6ff1826511f5e82dae7 100644
--- a/services/ui/ws/test_utils.cc
+++ b/services/ui/ws/test_utils.cc
@@ -395,8 +395,13 @@ void TestWindowTreeClient::GetWindowManager(
// TestWindowTreeBinding ------------------------------------------------------
-TestWindowTreeBinding::TestWindowTreeBinding(WindowTree* tree)
- : WindowTreeBinding(&client_), tree_(tree) {}
+TestWindowTreeBinding::TestWindowTreeBinding(
+ WindowTree* tree,
+ std::unique_ptr<TestWindowTreeClient> client)
+ : WindowTreeBinding(client.get()),
+ tree_(tree),
+ client_(std::move(client)) {}
+
TestWindowTreeBinding::~TestWindowTreeBinding() {}
mojom::WindowManager* TestWindowTreeBinding::GetWindowManager() {
@@ -408,6 +413,12 @@ void TestWindowTreeBinding::SetIncomingMethodCallProcessingPaused(bool paused) {
is_paused_ = paused;
}
+mojom::WindowTreeClient* TestWindowTreeBinding::CreateClientForShutdown() {
+ DCHECK(!client_after_reset_);
+ client_after_reset_ = base::MakeUnique<TestWindowTreeClient>();
+ return client_after_reset_.get();
+}
+
// TestWindowServerDelegate ----------------------------------------------
TestWindowServerDelegate::TestWindowServerDelegate() {}
@@ -431,8 +442,8 @@ TestWindowServerDelegate::CreateWindowTreeBinding(
ws::WindowTree* tree,
mojom::WindowTreeRequest* tree_request,
mojom::WindowTreeClientPtr* client) {
- std::unique_ptr<TestWindowTreeBinding> binding(
- new TestWindowTreeBinding(tree));
+ std::unique_ptr<TestWindowTreeBinding> binding =
+ base::MakeUnique<TestWindowTreeBinding>(tree);
bindings_.push_back(binding.get());
return std::move(binding);
}
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698