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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 EXPECT_EQ(owning_tree, wm_state_test_api.tree_awaiting_input_ack()); | 1005 EXPECT_EQ(owning_tree, wm_state_test_api.tree_awaiting_input_ack()); |
1006 AckPreviousEvent(); | 1006 AckPreviousEvent(); |
1007 | 1007 |
1008 // Set capture from the embedded client and make sure it gets the event. | 1008 // Set capture from the embedded client and make sure it gets the event. |
1009 ASSERT_TRUE( | 1009 ASSERT_TRUE( |
1010 embed_tree->SetCapture(ClientWindowIdForWindow(embed_tree, window))); | 1010 embed_tree->SetCapture(ClientWindowIdForWindow(embed_tree, window))); |
1011 DispatchEventWithoutAck(CreateMouseMoveEvent(22, 23)); | 1011 DispatchEventWithoutAck(CreateMouseMoveEvent(22, 23)); |
1012 EXPECT_EQ(embed_tree, wm_state_test_api.tree_awaiting_input_ack()); | 1012 EXPECT_EQ(embed_tree, wm_state_test_api.tree_awaiting_input_ack()); |
1013 } | 1013 } |
1014 | 1014 |
| 1015 TEST_F(WindowTreeTest, SetAcceptEvents) { |
| 1016 TestWindowTreeClient* embed_client = nullptr; |
| 1017 WindowTree* tree = nullptr; |
| 1018 ServerWindow* window = nullptr; |
| 1019 EXPECT_NO_FATAL_FAILURE(SetupEventTargeting(&embed_client, &tree, &window)); |
| 1020 |
| 1021 EXPECT_EQ(true, window->AcceptEvents()); |
| 1022 tree->SetAcceptEvents(ClientWindowIdForWindow(tree, window).id, false); |
| 1023 EXPECT_EQ(false, window->AcceptEvents()); |
| 1024 } |
| 1025 |
1015 } // namespace test | 1026 } // namespace test |
1016 } // namespace ws | 1027 } // namespace ws |
1017 } // namespace ui | 1028 } // namespace ui |
OLD | NEW |