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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 TestViewTreeClient() {} | 45 TestViewTreeClient() {} |
46 ~TestViewTreeClient() override {} | 46 ~TestViewTreeClient() override {} |
47 | 47 |
48 TestChangeTracker* tracker() { return &tracker_; } | 48 TestChangeTracker* tracker() { return &tracker_; } |
49 | 49 |
50 private: | 50 private: |
51 // ViewTreeClient: | 51 // ViewTreeClient: |
52 void OnEmbed(uint16_t connection_id, | 52 void OnEmbed(uint16_t connection_id, |
53 ViewDataPtr root, | 53 ViewDataPtr root, |
54 mojo::ViewTreePtr tree, | 54 mojo::ViewTreePtr tree, |
55 mojo::Id focused_view_id) override { | 55 mojo::Id focused_view_id, |
| 56 uint32_t access_policy) override { |
56 // TODO(sky): add test coverage of |focused_view_id|. | 57 // TODO(sky): add test coverage of |focused_view_id|. |
57 tracker_.OnEmbed(connection_id, root.Pass()); | 58 tracker_.OnEmbed(connection_id, root.Pass()); |
58 } | 59 } |
59 void OnEmbeddedAppDisconnected(uint32_t view) override { | 60 void OnEmbeddedAppDisconnected(uint32_t view) override { |
60 tracker_.OnEmbeddedAppDisconnected(view); | 61 tracker_.OnEmbeddedAppDisconnected(view); |
61 } | 62 } |
62 void OnUnembed() override { tracker_.OnUnembed(); } | 63 void OnUnembed() override { tracker_.OnUnembed(); } |
63 void OnViewBoundsChanged(uint32_t view, | 64 void OnViewBoundsChanged(uint32_t view, |
64 mojo::RectPtr old_bounds, | 65 mojo::RectPtr old_bounds, |
65 mojo::RectPtr new_bounds) override { | 66 mojo::RectPtr new_bounds) override { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 CreatePointerDownEvent(61, 22)); | 401 CreatePointerDownEvent(61, 22)); |
401 EXPECT_EQ(host_connection()->view_tree_host()->root_view(), | 402 EXPECT_EQ(host_connection()->view_tree_host()->root_view(), |
402 host_connection()->view_tree_host()->GetFocusedView()); | 403 host_connection()->view_tree_host()->GetFocusedView()); |
403 ASSERT_EQ(wm_client()->tracker()->changes()->size(), 1u); | 404 ASSERT_EQ(wm_client()->tracker()->changes()->size(), 1u); |
404 EXPECT_EQ("InputEvent view=0,2 event_action=4", | 405 EXPECT_EQ("InputEvent view=0,2 event_action=4", |
405 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); | 406 ChangesToDescription1(*wm_client()->tracker()->changes())[0]); |
406 EXPECT_TRUE(connection1_client->tracker()->changes()->empty()); | 407 EXPECT_TRUE(connection1_client->tracker()->changes()->empty()); |
407 } | 408 } |
408 | 409 |
409 } // namespace view_manager | 410 } // namespace view_manager |
OLD | NEW |