| 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 <limits.h> | 7 #include <limits.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 MouseEnterExitWindowDelegate d1; | 1279 MouseEnterExitWindowDelegate d1; |
| 1280 std::unique_ptr<Window> w1(CreateTestWindowWithDelegate( | 1280 std::unique_ptr<Window> w1(CreateTestWindowWithDelegate( |
| 1281 &d1, 1, gfx::Rect(10, 10, 50, 50), root_window())); | 1281 &d1, 1, gfx::Rect(10, 10, 50, 50), root_window())); |
| 1282 | 1282 |
| 1283 ui::test::EventGenerator generator(root_window()); | 1283 ui::test::EventGenerator generator(root_window()); |
| 1284 generator.MoveMouseToCenterOf(w1.get()); | 1284 generator.MoveMouseToCenterOf(w1.get()); |
| 1285 EXPECT_TRUE(d1.entered()); | 1285 EXPECT_TRUE(d1.entered()); |
| 1286 EXPECT_FALSE(d1.exited()); | 1286 EXPECT_FALSE(d1.exited()); |
| 1287 d1.ResetExpectations(); | 1287 d1.ResetExpectations(); |
| 1288 | 1288 |
| 1289 ui::MouseEvent exit_event(ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), | 1289 ui::MouseEvent exit_event( |
| 1290 ui::EventTimeForNow(), 0, 0); | 1290 ui::ET_MOUSE_EXITED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), 0, |
| 1291 0, ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE)); |
| 1291 DispatchEventUsingWindowDispatcher(&exit_event); | 1292 DispatchEventUsingWindowDispatcher(&exit_event); |
| 1292 EXPECT_FALSE(d1.entered()); | 1293 EXPECT_FALSE(d1.entered()); |
| 1293 EXPECT_TRUE(d1.exited()); | 1294 EXPECT_TRUE(d1.exited()); |
| 1294 } | 1295 } |
| 1295 | 1296 |
| 1296 // Verifies that the WindowDelegate receives MouseExit and MouseEnter events for | 1297 // Verifies that the WindowDelegate receives MouseExit and MouseEnter events for |
| 1297 // mouse transitions from window to window, even if the entered window sets | 1298 // mouse transitions from window to window, even if the entered window sets |
| 1298 // and releases capture. | 1299 // and releases capture. |
| 1299 TEST_P(WindowTest, MouseEnterExitWithClick) { | 1300 TEST_P(WindowTest, MouseEnterExitWithClick) { |
| 1300 MouseEnterExitWindowDelegate d1; | 1301 MouseEnterExitWindowDelegate d1; |
| (...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2936 ::testing::Values(BackendType::CLASSIC, | 2937 ::testing::Values(BackendType::CLASSIC, |
| 2937 BackendType::MUS)); | 2938 BackendType::MUS)); |
| 2938 | 2939 |
| 2939 INSTANTIATE_TEST_CASE_P(/* no prefix */, | 2940 INSTANTIATE_TEST_CASE_P(/* no prefix */, |
| 2940 WindowObserverTest, | 2941 WindowObserverTest, |
| 2941 ::testing::Values(BackendType::CLASSIC, | 2942 ::testing::Values(BackendType::CLASSIC, |
| 2942 BackendType::MUS)); | 2943 BackendType::MUS)); |
| 2943 | 2944 |
| 2944 } // namespace test | 2945 } // namespace test |
| 2945 } // namespace aura | 2946 } // namespace aura |
| OLD | NEW |