OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 scoped_ptr<Window> w1( | 1240 scoped_ptr<Window> w1( |
1241 CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50), | 1241 CreateTestWindowWithDelegate(&d1, 1, gfx::Rect(10, 10, 50, 50), |
1242 root_window())); | 1242 root_window())); |
1243 | 1243 |
1244 ui::test::EventGenerator generator(root_window()); | 1244 ui::test::EventGenerator generator(root_window()); |
1245 generator.MoveMouseToCenterOf(w1.get()); | 1245 generator.MoveMouseToCenterOf(w1.get()); |
1246 EXPECT_TRUE(d1.entered()); | 1246 EXPECT_TRUE(d1.entered()); |
1247 EXPECT_FALSE(d1.exited()); | 1247 EXPECT_FALSE(d1.exited()); |
1248 d1.ResetExpectations(); | 1248 d1.ResetExpectations(); |
1249 | 1249 |
1250 ui::MouseEvent exit_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), | 1250 ui::MouseEvent exit_event( |
1251 ui::EventTimeForNow(), 0, 0); | 1251 ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 0, |
| 1252 0, ui::PointerEventDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
1252 DispatchEventUsingWindowDispatcher(&exit_event); | 1253 DispatchEventUsingWindowDispatcher(&exit_event); |
1253 EXPECT_FALSE(d1.entered()); | 1254 EXPECT_FALSE(d1.entered()); |
1254 EXPECT_TRUE(d1.exited()); | 1255 EXPECT_TRUE(d1.exited()); |
1255 } | 1256 } |
1256 | 1257 |
1257 // Verifies that the WindowDelegate receives MouseExit and MouseEnter events for | 1258 // Verifies that the WindowDelegate receives MouseExit and MouseEnter events for |
1258 // mouse transitions from window to window, even if the entered window sets | 1259 // mouse transitions from window to window, even if the entered window sets |
1259 // and releases capture. | 1260 // and releases capture. |
1260 TEST_F(WindowTest, MouseEnterExitWithClick) { | 1261 TEST_F(WindowTest, MouseEnterExitWithClick) { |
1261 MouseEnterExitWindowDelegate d1; | 1262 MouseEnterExitWindowDelegate d1; |
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2920 | 2921 |
2921 EXPECT_TRUE(animator.get()); | 2922 EXPECT_TRUE(animator.get()); |
2922 EXPECT_FALSE(animator->is_animating()); | 2923 EXPECT_FALSE(animator->is_animating()); |
2923 EXPECT_TRUE(observer.animation_completed()); | 2924 EXPECT_TRUE(observer.animation_completed()); |
2924 EXPECT_FALSE(observer.animation_aborted()); | 2925 EXPECT_FALSE(observer.animation_aborted()); |
2925 animator->RemoveObserver(&observer); | 2926 animator->RemoveObserver(&observer); |
2926 } | 2927 } |
2927 | 2928 |
2928 } // namespace test | 2929 } // namespace test |
2929 } // namespace aura | 2930 } // namespace aura |
OLD | NEW |