| OLD | NEW |
| 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 "services/ui/ws/window_server_test_impl.h" | 5 #include "services/ui/ws/window_server_test_impl.h" |
| 6 | 6 |
| 7 #include "services/ui/public/interfaces/window_tree.mojom.h" | 7 #include "services/ui/public/interfaces/window_tree.mojom.h" |
| 8 #include "services/ui/ws/server_window.h" | 8 #include "services/ui/ws/server_window.h" |
| 9 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" | 9 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" |
| 10 #include "services/ui/ws/window_server.h" | 10 #include "services/ui/ws/window_server.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 WindowTree* tree = window_server_->GetTreeWithClientName(name); | 37 WindowTree* tree = window_server_->GetTreeWithClientName(name); |
| 38 if (!tree) | 38 if (!tree) |
| 39 return; | 39 return; |
| 40 if (tree->HasRoot(window) && WindowHasValidFrame(window)) { | 40 if (tree->HasRoot(window) && WindowHasValidFrame(window)) { |
| 41 cb.Run(true); | 41 cb.Run(true); |
| 42 window_server_->SetPaintCallback(base::Callback<void(ServerWindow*)>()); | 42 window_server_->SetPaintCallback(base::Callback<void(ServerWindow*)>()); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 void WindowServerTestImpl::EnsureClientHasDrawnWindow( | 46 void WindowServerTestImpl::EnsureClientHasDrawnWindow( |
| 47 const mojo::String& client_name, | 47 const std::string& client_name, |
| 48 const EnsureClientHasDrawnWindowCallback& callback) { | 48 const EnsureClientHasDrawnWindowCallback& callback) { |
| 49 std::string name = client_name.To<std::string>(); | 49 WindowTree* tree = window_server_->GetTreeWithClientName(client_name); |
| 50 WindowTree* tree = window_server_->GetTreeWithClientName(name); | |
| 51 if (tree) { | 50 if (tree) { |
| 52 for (const ServerWindow* window : tree->roots()) { | 51 for (const ServerWindow* window : tree->roots()) { |
| 53 if (WindowHasValidFrame(window)) { | 52 if (WindowHasValidFrame(window)) { |
| 54 callback.Run(true); | 53 callback.Run(true); |
| 55 return; | 54 return; |
| 56 } | 55 } |
| 57 } | 56 } |
| 58 } | 57 } |
| 59 | 58 |
| 60 window_server_->SetPaintCallback( | 59 window_server_->SetPaintCallback( |
| 61 base::Bind(&WindowServerTestImpl::OnWindowPaint, base::Unretained(this), | 60 base::Bind(&WindowServerTestImpl::OnWindowPaint, base::Unretained(this), |
| 62 name, std::move(callback))); | 61 client_name, std::move(callback))); |
| 63 } | 62 } |
| 64 | 63 |
| 65 } // namespace ws | 64 } // namespace ws |
| 66 } // namespace ui | 65 } // namespace ui |
| OLD | NEW |