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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 mus::mojom::WindowTreePtr tree, | 114 mus::mojom::WindowTreePtr tree, |
115 Id focused_window_id, | 115 Id focused_window_id, |
116 uint32_t access_policy) override { | 116 uint32_t access_policy) override { |
117 // TODO(sky): add test coverage of |focused_window_id|. | 117 // TODO(sky): add test coverage of |focused_window_id|. |
118 tracker_.OnEmbed(connection_id, std::move(root)); | 118 tracker_.OnEmbed(connection_id, std::move(root)); |
119 } | 119 } |
120 void OnEmbeddedAppDisconnected(uint32_t window) override { | 120 void OnEmbeddedAppDisconnected(uint32_t window) override { |
121 tracker_.OnEmbeddedAppDisconnected(window); | 121 tracker_.OnEmbeddedAppDisconnected(window); |
122 } | 122 } |
123 void OnUnembed(Id window_id) override { tracker_.OnUnembed(window_id); } | 123 void OnUnembed(Id window_id) override { tracker_.OnUnembed(window_id); } |
| 124 void OnTopLevelCreated(uint32_t change_id, |
| 125 mojom::WindowDataPtr data) override { |
| 126 tracker_.OnTopLevelCreated(change_id, std::move(data)); |
| 127 } |
124 void OnWindowBoundsChanged(uint32_t window, | 128 void OnWindowBoundsChanged(uint32_t window, |
125 mojo::RectPtr old_bounds, | 129 mojo::RectPtr old_bounds, |
126 mojo::RectPtr new_bounds) override { | 130 mojo::RectPtr new_bounds) override { |
127 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), | 131 tracker_.OnWindowBoundsChanged(window, std::move(old_bounds), |
128 std::move(new_bounds)); | 132 std::move(new_bounds)); |
129 } | 133 } |
130 void OnClientAreaChanged( | 134 void OnClientAreaChanged( |
131 uint32_t window_id, | 135 uint32_t window_id, |
132 mojo::InsetsPtr new_client_area, | 136 mojo::InsetsPtr new_client_area, |
133 mojo::Array<mojo::RectPtr> new_additional_client_areas) override {} | 137 mojo::Array<mojo::RectPtr> new_additional_client_areas) override {} |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 EXPECT_TRUE( | 832 EXPECT_TRUE( |
829 wm_connection()->NewWindow(embed_window_id2, ServerWindow::Properties())); | 833 wm_connection()->NewWindow(embed_window_id2, ServerWindow::Properties())); |
830 EXPECT_TRUE(wm_connection()->AddWindow(FirstRoot(wm_connection())->id(), | 834 EXPECT_TRUE(wm_connection()->AddWindow(FirstRoot(wm_connection())->id(), |
831 embed_window_id2)); | 835 embed_window_id2)); |
832 | 836 |
833 // Ack the change, which should resume the binding. | 837 // Ack the change, which should resume the binding. |
834 static_cast<mojom::WindowManagerInternalClient*>(wm_connection()) | 838 static_cast<mojom::WindowManagerInternalClient*>(wm_connection()) |
835 ->OnWmCreatedTopLevelWindow(wm_change_id, | 839 ->OnWmCreatedTopLevelWindow(wm_change_id, |
836 WindowIdToTransportId(embed_window_id2)); | 840 WindowIdToTransportId(embed_window_id2)); |
837 EXPECT_FALSE(last_client_connection()->is_paused()); | 841 EXPECT_FALSE(last_client_connection()->is_paused()); |
838 EXPECT_EQ("ChangeCompleted id=17 sucess=true", | 842 EXPECT_EQ("TopLevelCreated id=17 window_id=" + |
| 843 WindowIdToString(embed_window_id2_in_child), |
839 SingleChangeToDescription(*embed_connection->tracker()->changes())); | 844 SingleChangeToDescription(*embed_connection->tracker()->changes())); |
840 embed_connection->tracker()->changes()->clear(); | 845 embed_connection->tracker()->changes()->clear(); |
841 | 846 |
842 // Change the visibility of the window from the owner and make sure the | 847 // Change the visibility of the window from the owner and make sure the |
843 // client sees the right id. | 848 // client sees the right id. |
844 ServerWindow* embed_window = wm_connection()->GetWindow(embed_window_id2); | 849 ServerWindow* embed_window = wm_connection()->GetWindow(embed_window_id2); |
845 ASSERT_TRUE(embed_window); | 850 ASSERT_TRUE(embed_window); |
846 EXPECT_FALSE(embed_window->visible()); | 851 EXPECT_FALSE(embed_window->visible()); |
847 ASSERT_TRUE(wm_connection()->SetWindowVisibility(embed_window->id(), true)); | 852 ASSERT_TRUE(wm_connection()->SetWindowVisibility(embed_window->id(), true)); |
848 EXPECT_TRUE(embed_window->visible()); | 853 EXPECT_TRUE(embed_window->visible()); |
849 EXPECT_EQ("VisibilityChanged window=" + | 854 EXPECT_EQ("VisibilityChanged window=" + |
850 WindowIdToString(embed_window_id2_in_child) + " visible=true", | 855 WindowIdToString(embed_window_id2_in_child) + " visible=true", |
851 SingleChangeToDescription(*embed_connection->tracker()->changes())); | 856 SingleChangeToDescription(*embed_connection->tracker()->changes())); |
852 | 857 |
853 // Set the visibility from the child using the client assigned id. | 858 // Set the visibility from the child using the client assigned id. |
854 ASSERT_TRUE(window_tree_connection->SetWindowVisibility( | 859 ASSERT_TRUE(window_tree_connection->SetWindowVisibility( |
855 embed_window_id2_in_child, false)); | 860 embed_window_id2_in_child, false)); |
856 EXPECT_FALSE(embed_window->visible()); | 861 EXPECT_FALSE(embed_window->visible()); |
857 } | 862 } |
858 | 863 |
859 } // namespace ws | 864 } // namespace ws |
860 } // namespace mus | 865 } // namespace mus |
OLD | NEW |