| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 }; | 612 }; |
| 613 | 613 |
| 614 // Verifies two clients/connections get different ids. | 614 // Verifies two clients/connections get different ids. |
| 615 TEST_F(WindowTreeClientTest, TwoClientsGetDifferentConnectionIds) { | 615 TEST_F(WindowTreeClientTest, TwoClientsGetDifferentConnectionIds) { |
| 616 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(true)); | 616 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(true)); |
| 617 | 617 |
| 618 ASSERT_EQ(1u, changes2()->size()); | 618 ASSERT_EQ(1u, changes2()->size()); |
| 619 ASSERT_NE(connection_id_1(), connection_id_2()); | 619 ASSERT_NE(connection_id_1(), connection_id_2()); |
| 620 } | 620 } |
| 621 | 621 |
| 622 // Disabled due to flakes on win8_chromium_ng; see https://crbug.com/598925. |
| 623 #if defined(OS_WIN) |
| 624 #define MAYBE_WindowsRemovedWhenEmbedding \ |
| 625 DISABLED_WindowsRemovedWhenEmbedding |
| 626 #else |
| 627 #define MAYBE_WindowsRemovedWhenEmbedding WindowsRemovedWhenEmbedding |
| 628 #endif |
| 622 // Verifies when Embed() is invoked any child windows are removed. | 629 // Verifies when Embed() is invoked any child windows are removed. |
| 623 TEST_F(WindowTreeClientTest, WindowsRemovedWhenEmbedding) { | 630 TEST_F(WindowTreeClientTest, MAYBE_WindowsRemovedWhenEmbedding) { |
| 624 // Two windows 1 and 2. 2 is parented to 1. | 631 // Two windows 1 and 2. 2 is parented to 1. |
| 625 Id window_1_1 = wt_client1()->NewWindow(1); | 632 Id window_1_1 = wt_client1()->NewWindow(1); |
| 626 ASSERT_TRUE(window_1_1); | 633 ASSERT_TRUE(window_1_1); |
| 627 ASSERT_TRUE(wt_client1()->AddWindow(root_window_id(), window_1_1)); | 634 ASSERT_TRUE(wt_client1()->AddWindow(root_window_id(), window_1_1)); |
| 628 | 635 |
| 629 Id window_1_2 = wt_client1()->NewWindow(2); | 636 Id window_1_2 = wt_client1()->NewWindow(2); |
| 630 ASSERT_TRUE(window_1_2); | 637 ASSERT_TRUE(window_1_2); |
| 631 ASSERT_TRUE(wt_client1()->AddWindow(window_1_1, window_1_2)); | 638 ASSERT_TRUE(wt_client1()->AddWindow(window_1_1, window_1_2)); |
| 632 | 639 |
| 633 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false)); | 640 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false)); |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 TestWindowTreeClientImpl client2; | 1701 TestWindowTreeClientImpl client2; |
| 1695 mojom::WindowTreeClientPtr client2_ptr; | 1702 mojom::WindowTreeClientPtr client2_ptr; |
| 1696 mojo::Binding<WindowTreeClient> client2_binding(&client2, &client2_ptr); | 1703 mojo::Binding<WindowTreeClient> client2_binding(&client2, &client2_ptr); |
| 1697 ASSERT_TRUE(Embed(wt1(), BuildWindowId(connection_id_1(), 1), | 1704 ASSERT_TRUE(Embed(wt1(), BuildWindowId(connection_id_1(), 1), |
| 1698 std::move(client2_ptr))); | 1705 std::move(client2_ptr))); |
| 1699 client2.WaitForOnEmbed(); | 1706 client2.WaitForOnEmbed(); |
| 1700 EXPECT_EQ("OnEmbed", | 1707 EXPECT_EQ("OnEmbed", |
| 1701 SingleChangeToDescription(*client2.tracker()->changes())); | 1708 SingleChangeToDescription(*client2.tracker()->changes())); |
| 1702 } | 1709 } |
| 1703 | 1710 |
| 1704 // Disabled due to flakes on win8_chromium_ng; see https://crbug.com/598925. | 1711 TEST_F(WindowTreeClientTest, EmbedFailsFromOtherConnection) { |
| 1705 #if defined(OS_WIN) | |
| 1706 #define MAYBE_EmbedFailsFromOtherConnection \ | |
| 1707 DISABLED_EmbedFailsFromOtherConnection | |
| 1708 #else | |
| 1709 #define MAYBE_EmbedFailsFromOtherConnection EmbedFailsFromOtherConnection | |
| 1710 #endif | |
| 1711 TEST_F(WindowTreeClientTest, MAYBE_EmbedFailsFromOtherConnection) { | |
| 1712 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(true)); | 1712 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(true)); |
| 1713 | 1713 |
| 1714 Id window_1_1 = BuildWindowId(connection_id_1(), 1); | 1714 Id window_1_1 = BuildWindowId(connection_id_1(), 1); |
| 1715 Id window_2_1 = wt_client2()->NewWindow(1); | 1715 Id window_2_1 = wt_client2()->NewWindow(1); |
| 1716 ASSERT_TRUE(window_2_1); | 1716 ASSERT_TRUE(window_2_1); |
| 1717 ASSERT_TRUE(wt_client2()->AddWindow(window_1_1, window_2_1)); | 1717 ASSERT_TRUE(wt_client2()->AddWindow(window_1_1, window_2_1)); |
| 1718 ASSERT_NO_FATAL_FAILURE(EstablishThirdConnection(wt2(), window_2_1)); | 1718 ASSERT_NO_FATAL_FAILURE(EstablishThirdConnection(wt2(), window_2_1)); |
| 1719 | 1719 |
| 1720 Id window_3_3 = wt_client3()->NewWindow(3); | 1720 Id window_3_3 = wt_client3()->NewWindow(3); |
| 1721 ASSERT_TRUE(window_3_3); | 1721 ASSERT_TRUE(window_3_3); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 | 1923 |
| 1924 // TODO(sky): make sure coverage of what was | 1924 // TODO(sky): make sure coverage of what was |
| 1925 // WindowManagerTest.SecondEmbedRoot_InitService and | 1925 // WindowManagerTest.SecondEmbedRoot_InitService and |
| 1926 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window | 1926 // WindowManagerTest.MultipleEmbedRootsBeforeWTHReady gets added to window |
| 1927 // manager | 1927 // manager |
| 1928 // tests. | 1928 // tests. |
| 1929 | 1929 |
| 1930 } // namespace test | 1930 } // namespace test |
| 1931 } // namespace ws | 1931 } // namespace ws |
| 1932 } // namespace mus | 1932 } // namespace mus |
| OLD | NEW |