OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
9 #include "ui/views/test/widget_test.h" | 9 #include "ui/views/test/widget_test.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 widget2.SetCapture(widget2.GetRootView()); | 773 widget2.SetCapture(widget2.GetRootView()); |
774 EXPECT_FALSE(widget1.HasCapture()); | 774 EXPECT_FALSE(widget1.HasCapture()); |
775 EXPECT_TRUE(widget2.HasCapture()); | 775 EXPECT_TRUE(widget2.HasCapture()); |
776 | 776 |
777 widget1.GetAndClearGotMouseEvent(); | 777 widget1.GetAndClearGotMouseEvent(); |
778 widget2.GetAndClearGotMouseEvent(); | 778 widget2.GetAndClearGotMouseEvent(); |
779 // Send a mouse event to the RootWindow associated with |widget1|. Even though | 779 // Send a mouse event to the RootWindow associated with |widget1|. Even though |
780 // |widget2| has capture, |widget1| should still get the event. | 780 // |widget2| has capture, |widget1| should still get the event. |
781 ui::MouseEvent mouse_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), | 781 ui::MouseEvent mouse_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), |
782 ui::EF_NONE, ui::EF_NONE); | 782 ui::EF_NONE, ui::EF_NONE); |
783 widget1.GetNativeWindow()->GetDispatcher()->AsWindowTreeHostDelegate()-> | 783 ui::EventDispatchDetails details = widget1.GetNativeWindow()-> |
784 OnHostMouseEvent(&mouse_event); | 784 GetDispatcher()->OnEventFromSource(&mouse_event); |
| 785 ASSERT_FALSE(details.dispatcher_destroyed); |
785 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); | 786 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); |
786 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); | 787 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); |
787 } | 788 } |
788 #endif | 789 #endif |
789 | 790 |
790 } // namespace test | 791 } // namespace test |
791 } // namespace views | 792 } // namespace views |
OLD | NEW |