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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 TestViewTreeClient* wm_client() { return wm_client_; } | 294 TestViewTreeClient* wm_client() { return wm_client_; } |
295 | 295 |
296 TestViewManagerRootConnection* root_connection() { return root_connection_; } | 296 TestViewManagerRootConnection* root_connection() { return root_connection_; } |
297 | 297 |
298 protected: | 298 protected: |
299 // testing::Test: | 299 // testing::Test: |
300 void SetUp() override { | 300 void SetUp() override { |
301 DisplayManager::set_factory_for_testing(&display_manager_factory_); | 301 DisplayManager::set_factory_for_testing(&display_manager_factory_); |
302 // TODO(fsamuel): This is probably broken. We need a root. | 302 // TODO(fsamuel): This is probably broken. We need a root. |
303 connection_manager_.reset(new ConnectionManager(&delegate_)); | 303 connection_manager_.reset( |
| 304 new ConnectionManager(&delegate_, |
| 305 scoped_refptr<surfaces::SurfacesState>())); |
304 ViewManagerRootImpl* root = new ViewManagerRootImpl( | 306 ViewManagerRootImpl* root = new ViewManagerRootImpl( |
305 connection_manager_.get(), true /* is_headless */, nullptr, | 307 connection_manager_.get(), true /* is_headless */, nullptr, |
306 scoped_refptr<gles2::GpuState>(), | 308 scoped_refptr<gles2::GpuState>(), |
307 scoped_refptr<surfaces::SurfacesState>()); | 309 scoped_refptr<surfaces::SurfacesState>()); |
308 // TODO(fsamuel): This is way too magical. We need to find a better way to | 310 // TODO(fsamuel): This is way too magical. We need to find a better way to |
309 // manage lifetime. | 311 // manage lifetime. |
310 root_connection_ = new TestViewManagerRootConnection( | 312 root_connection_ = new TestViewManagerRootConnection( |
311 make_scoped_ptr(root), connection_manager_.get()); | 313 make_scoped_ptr(root), connection_manager_.get()); |
312 root->Init(root_connection_); | 314 root->Init(root_connection_); |
313 wm_client_ = delegate_.last_client(); | 315 wm_client_ = delegate_.last_client(); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 CreatePointerDownEvent(61, 22)); | 605 CreatePointerDownEvent(61, 22)); |
604 EXPECT_EQ(root_connection()->view_manager_root()->root_view(), | 606 EXPECT_EQ(root_connection()->view_manager_root()->root_view(), |
605 connection_manager()->GetFocusedView()); | 607 connection_manager()->GetFocusedView()); |
606 ASSERT_EQ(wm_client()->tracker()->changes()->size(), 1u); | 608 ASSERT_EQ(wm_client()->tracker()->changes()->size(), 1u); |
607 EXPECT_EQ("InputEvent view=0,2 event_action=4", | 609 EXPECT_EQ("InputEvent view=0,2 event_action=4", |
608 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); | 610 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); |
609 EXPECT_TRUE(connection1_client->tracker()->changes()->empty()); | 611 EXPECT_TRUE(connection1_client->tracker()->changes()->empty()); |
610 } | 612 } |
611 | 613 |
612 } // namespace view_manager | 614 } // namespace view_manager |
OLD | NEW |