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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/public/cpp/tests/window_tree_client_private.h" 5 #include "components/mus/public/cpp/tests/window_tree_client_private.h"
6 6
7 #include "base/run_loop.h"
8 #include "components/mus/public/cpp/lib/in_flight_change.h"
7 #include "components/mus/public/cpp/window.h" 9 #include "components/mus/public/cpp/window.h"
8 #include "components/mus/public/cpp/window_tree_client.h" 10 #include "components/mus/public/cpp/window_tree_client.h"
9 11
10 namespace mus { 12 namespace mus {
11 13
12 WindowTreeClientPrivate::WindowTreeClientPrivate( 14 WindowTreeClientPrivate::WindowTreeClientPrivate(
13 WindowTreeClient* tree_client_impl) 15 WindowTreeClient* tree_client_impl)
14 : tree_client_impl_(tree_client_impl) {} 16 : tree_client_impl_(tree_client_impl) {}
15 17
16 WindowTreeClientPrivate::WindowTreeClientPrivate(Window* window) 18 WindowTreeClientPrivate::WindowTreeClientPrivate(Window* window)
(...skipping 19 matching lines...) Expand all
36 38
37 void WindowTreeClientPrivate::CallOnWindowInputEvent( 39 void WindowTreeClientPrivate::CallOnWindowInputEvent(
38 Window* window, 40 Window* window,
39 std::unique_ptr<ui::Event> event) { 41 std::unique_ptr<ui::Event> event) {
40 const uint32_t event_id = 0u; 42 const uint32_t event_id = 0u;
41 const uint32_t observer_id = 0u; 43 const uint32_t observer_id = 0u;
42 tree_client_impl_->OnWindowInputEvent(event_id, window->server_id(), 44 tree_client_impl_->OnWindowInputEvent(event_id, window->server_id(),
43 std::move(event), observer_id); 45 std::move(event), observer_id);
44 } 46 }
45 47
48 void WindowTreeClientPrivate::ClearInFlightQueue() {
49 tree_client_impl_->in_flight_map_.clear();
50 }
51
52 void WindowTreeClientPrivate::WaitForInFlightQueue() {
53 while (!tree_client_impl_->in_flight_map_.empty()) {
54 base::RunLoop run_loop;
55 run_loop.RunUntilIdle();
56 }
57 }
58
46 } // namespace mus 59 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698