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

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

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 | « no previous file | services/ui/ws/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/test_utils.h
diff --git a/services/ui/ws/test_utils.h b/services/ui/ws/test_utils.h
index 281d75623ae66e52a767f9f7de5ee16df6859d70..899b35d41e6eb15536e02a5ff32e97e2f3f4e8dd 100644
--- a/services/ui/ws/test_utils.h
+++ b/services/ui/ws/test_utils.h
@@ -10,6 +10,7 @@
#include <memory>
#include <vector>
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "services/ui/public/interfaces/display.mojom.h"
#include "services/ui/public/interfaces/window_tree.mojom.h"
@@ -473,11 +474,17 @@ class TestWindowTreeClient : public ui::mojom::WindowTreeClient {
// WindowTreeBinding implementation that vends TestWindowTreeBinding.
class TestWindowTreeBinding : public WindowTreeBinding {
public:
- explicit TestWindowTreeBinding(WindowTree* tree);
+ TestWindowTreeBinding(WindowTree* tree,
+ std::unique_ptr<TestWindowTreeClient> client =
+ base::MakeUnique<TestWindowTreeClient>());
~TestWindowTreeBinding() override;
+ std::unique_ptr<TestWindowTreeClient> ReleaseClient() {
+ return std::move(client_);
+ }
+
WindowTree* tree() { return tree_; }
- TestWindowTreeClient* client() { return &client_; }
+ TestWindowTreeClient* client() { return client_.get(); }
TestWindowManager* window_manager() { return window_manager_.get(); }
bool is_paused() const { return is_paused_; }
@@ -486,9 +493,15 @@ class TestWindowTreeBinding : public WindowTreeBinding {
mojom::WindowManager* GetWindowManager() override;
void SetIncomingMethodCallProcessingPaused(bool paused) override;
+ protected:
+ // WindowTreeBinding:
+ mojom::WindowTreeClient* CreateClientForShutdown() override;
+
private:
WindowTree* tree_;
- TestWindowTreeClient client_;
+ std::unique_ptr<TestWindowTreeClient> client_;
+ // This is the client created once ResetClientForShutdown() is called.
+ std::unique_ptr<TestWindowTreeClient> client_after_reset_;
bool is_paused_ = false;
std::unique_ptr<TestWindowManager> window_manager_;
« no previous file with comments | « no previous file | services/ui/ws/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698