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

Unified Diff: ui/aura/test/mus/change_completion_waiter.h

Issue 2633233003: aura-mus: Implement stacking in DesktopWindowTreeHostMus. (Closed)
Patch Set: Reword comment. Created 3 years, 11 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 | « ui/aura/mus/window_tree_host_mus_delegate.h ('k') | ui/aura/test/mus/change_completion_waiter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/mus/change_completion_waiter.h
diff --git a/ui/aura/test/mus/change_completion_waiter.h b/ui/aura/test/mus/change_completion_waiter.h
new file mode 100644
index 0000000000000000000000000000000000000000..bad862376e753fcefe699c2d14edb140749789fc
--- /dev/null
+++ b/ui/aura/test/mus/change_completion_waiter.h
@@ -0,0 +1,58 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_AURA_TEST_MUS_CHANGE_COMPLETION_WAITER_H_
+#define UI_AURA_TEST_MUS_CHANGE_COMPLETION_WAITER_H_
+
+#include "base/callback_forward.h"
+#include "base/run_loop.h"
+#include "ui/aura/mus/window_tree_client_test_observer.h"
+
+namespace aura {
+class WindowTreeClient;
+enum class ChangeType;
+
+namespace test {
+
+// A class which will Wait for next change of |type| to complete.
+class ChangeCompletionWaiter : public WindowTreeClientTestObserver {
+ public:
+ ChangeCompletionWaiter(WindowTreeClient* client,
+ ChangeType type,
+ bool success);
+ ~ChangeCompletionWaiter() override;
+
+ // Wait for the first change that occurred after construction of this object
+ // of |type| to complete. May return immediately if it's already done.
+ void Wait();
+
+ private:
+ // WindowTreeClientTestObserver:
+ void OnChangeStarted(uint32_t change_id,
+ aura::ChangeType type) override;
+ void OnChangeCompleted(uint32_t change_id,
+ aura::ChangeType type,
+ bool success) override;
+
+ base::RunLoop run_loop_;
+ base::Closure quit_closure_;
+
+ enum class WaitState {
+ NOT_STARTED,
+ WAITING,
+ RECEIVED
+ } state_;
+
+ WindowTreeClient* client_;
+ aura::ChangeType type_;
+ uint32_t change_id_;
+ bool success_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChangeCompletionWaiter);
+};
+
+} // namespace test
+} // namespace aura
+
+#endif // UI_AURA_TEST_MUS_CHANGE_COMPLETION_WAITER_H_
« no previous file with comments | « ui/aura/mus/window_tree_host_mus_delegate.h ('k') | ui/aura/test/mus/change_completion_waiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698