OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "components/view_manager/client_connection.h" | 9 #include "components/view_manager/client_connection.h" |
10 #include "components/view_manager/connection_manager.h" | 10 #include "components/view_manager/connection_manager.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 TestViewTreeClient* wm_client() { return wm_client_; } | 290 TestViewTreeClient* wm_client() { return wm_client_; } |
291 | 291 |
292 TestViewTreeHostConnection* host_connection() { return host_connection_; } | 292 TestViewTreeHostConnection* host_connection() { return host_connection_; } |
293 | 293 |
294 protected: | 294 protected: |
295 // testing::Test: | 295 // testing::Test: |
296 void SetUp() override { | 296 void SetUp() override { |
297 DisplayManager::set_factory_for_testing(&display_manager_factory_); | 297 DisplayManager::set_factory_for_testing(&display_manager_factory_); |
298 // TODO(fsamuel): This is probably broken. We need a root. | 298 // TODO(fsamuel): This is probably broken. We need a root. |
299 connection_manager_.reset(new ConnectionManager(&delegate_)); | 299 connection_manager_.reset( |
| 300 new ConnectionManager(&delegate_, |
| 301 scoped_refptr<surfaces::SurfacesState>())); |
300 ViewTreeHostImpl* host = new ViewTreeHostImpl( | 302 ViewTreeHostImpl* host = new ViewTreeHostImpl( |
301 mojo::ViewTreeHostClientPtr(), | 303 mojo::ViewTreeHostClientPtr(), |
302 connection_manager_.get(), true /* is_headless */, nullptr, | 304 connection_manager_.get(), true /* is_headless */, nullptr, |
303 scoped_refptr<gles2::GpuState>(), | 305 scoped_refptr<gles2::GpuState>(), |
304 scoped_refptr<surfaces::SurfacesState>()); | 306 scoped_refptr<surfaces::SurfacesState>()); |
305 // TODO(fsamuel): This is way too magical. We need to find a better way to | 307 // TODO(fsamuel): This is way too magical. We need to find a better way to |
306 // manage lifetime. | 308 // manage lifetime. |
307 host_connection_ = new TestViewTreeHostConnection( | 309 host_connection_ = new TestViewTreeHostConnection( |
308 make_scoped_ptr(host), connection_manager_.get()); | 310 make_scoped_ptr(host), connection_manager_.get()); |
309 host->Init(host_connection_); | 311 host->Init(host_connection_); |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 CreatePointerDownEvent(61, 22)); | 599 CreatePointerDownEvent(61, 22)); |
598 EXPECT_EQ(host_connection()->view_tree_host()->root_view(), | 600 EXPECT_EQ(host_connection()->view_tree_host()->root_view(), |
599 connection_manager()->GetFocusedView()); | 601 connection_manager()->GetFocusedView()); |
600 ASSERT_EQ(wm_client()->tracker()->changes()->size(), 1u); | 602 ASSERT_EQ(wm_client()->tracker()->changes()->size(), 1u); |
601 EXPECT_EQ("InputEvent view=0,2 event_action=4", | 603 EXPECT_EQ("InputEvent view=0,2 event_action=4", |
602 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); | 604 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); |
603 EXPECT_TRUE(connection1_client->tracker()->changes()->empty()); | 605 EXPECT_TRUE(connection1_client->tracker()->changes()->empty()); |
604 } | 606 } |
605 | 607 |
606 } // namespace view_manager | 608 } // namespace view_manager |
OLD | NEW |