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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 EXPECT_TRUE( | 694 EXPECT_TRUE( |
695 wm_tree()->NewWindow(embed_window_id2, ServerWindow::Properties())); | 695 wm_tree()->NewWindow(embed_window_id2, ServerWindow::Properties())); |
696 EXPECT_TRUE(wm_tree()->SetWindowVisibility(embed_window_id2, true)); | 696 EXPECT_TRUE(wm_tree()->SetWindowVisibility(embed_window_id2, true)); |
697 EXPECT_TRUE(wm_tree()->AddWindow(FirstRootId(wm_tree()), embed_window_id2)); | 697 EXPECT_TRUE(wm_tree()->AddWindow(FirstRootId(wm_tree()), embed_window_id2)); |
698 | 698 |
699 // Ack the change, which should resume the binding. | 699 // Ack the change, which should resume the binding. |
700 child_binding->client()->tracker()->changes()->clear(); | 700 child_binding->client()->tracker()->changes()->clear(); |
701 static_cast<mojom::WindowManagerClient*>(wm_tree()) | 701 static_cast<mojom::WindowManagerClient*>(wm_tree()) |
702 ->OnWmCreatedTopLevelWindow(wm_change_id, embed_window_id2.id); | 702 ->OnWmCreatedTopLevelWindow(wm_change_id, embed_window_id2.id); |
703 EXPECT_FALSE(child_binding->is_paused()); | 703 EXPECT_FALSE(child_binding->is_paused()); |
704 EXPECT_EQ("TopLevelCreated id=17 window_id=" + | 704 ServerWindow* embed_window = wm_tree()->GetWindowByClientId(embed_window_id2); |
705 WindowIdToString( | 705 ASSERT_TRUE(embed_window); |
706 WindowIdFromTransportId(embed_window_id2_in_child.id)) + | 706 // TODO(fsamuel): Currently the FrameSinkId maps directly to the server's |
707 " drawn=true", | 707 // window ID. This is likely bad from a security perspective and should be |
708 SingleChangeToDescription( | 708 // fixed. |
709 *child_binding->client()->tracker()->changes())); | 709 EXPECT_EQ( |
| 710 base::StringPrintf( |
| 711 "TopLevelCreated id=17 FrameSinkId(%d, 0) window_id=%s drawn=true", |
| 712 WindowIdToTransportId(embed_window->id()), |
| 713 WindowIdToString( |
| 714 WindowIdFromTransportId(embed_window_id2_in_child.id)) |
| 715 .c_str()), |
| 716 SingleChangeToDescription( |
| 717 *child_binding->client()->tracker()->changes())); |
710 child_binding->client()->tracker()->changes()->clear(); | 718 child_binding->client()->tracker()->changes()->clear(); |
711 | 719 |
712 // Change the visibility of the window from the owner and make sure the | 720 // Change the visibility of the window from the owner and make sure the |
713 // client sees the right id. | 721 // client sees the right id. |
714 ServerWindow* embed_window = wm_tree()->GetWindowByClientId(embed_window_id2); | |
715 ASSERT_TRUE(embed_window); | |
716 EXPECT_TRUE(embed_window->visible()); | 722 EXPECT_TRUE(embed_window->visible()); |
717 ASSERT_TRUE(wm_tree()->SetWindowVisibility( | 723 ASSERT_TRUE(wm_tree()->SetWindowVisibility( |
718 ClientWindowIdForWindow(wm_tree(), embed_window), false)); | 724 ClientWindowIdForWindow(wm_tree(), embed_window), false)); |
719 EXPECT_FALSE(embed_window->visible()); | 725 EXPECT_FALSE(embed_window->visible()); |
720 EXPECT_EQ("VisibilityChanged window=" + | 726 EXPECT_EQ("VisibilityChanged window=" + |
721 WindowIdToString( | 727 WindowIdToString( |
722 WindowIdFromTransportId(embed_window_id2_in_child.id)) + | 728 WindowIdFromTransportId(embed_window_id2_in_child.id)) + |
723 " visible=false", | 729 " visible=false", |
724 SingleChangeToDescription( | 730 SingleChangeToDescription( |
725 *child_binding->client()->tracker()->changes())); | 731 *child_binding->client()->tracker()->changes())); |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 client->tracker()->changes()->clear(); | 1461 client->tracker()->changes()->clear(); |
1456 } | 1462 } |
1457 | 1463 |
1458 // Client should not have got any messages after shutdown. | 1464 // Client should not have got any messages after shutdown. |
1459 EXPECT_TRUE(client->tracker()->changes()->empty()); | 1465 EXPECT_TRUE(client->tracker()->changes()->empty()); |
1460 } | 1466 } |
1461 | 1467 |
1462 } // namespace test | 1468 } // namespace test |
1463 } // namespace ws | 1469 } // namespace ws |
1464 } // namespace ui | 1470 } // namespace ui |
OLD | NEW |