| 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 "ash/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 #include "ash/display/display_manager.h" | 6 #include "ash/display/display_manager.h" |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 generator2.MoveMouseTo(-985, 15); | 434 generator2.MoveMouseTo(-985, 15); |
| 435 EXPECT_EQ("0 1 0", r1_d1.GetMouseMotionCountsAndReset()); | 435 EXPECT_EQ("0 1 0", r1_d1.GetMouseMotionCountsAndReset()); |
| 436 | 436 |
| 437 r1_w2->SetCapture(); | 437 r1_w2->SetCapture(); |
| 438 EXPECT_EQ(r1_w2.get(), | 438 EXPECT_EQ(r1_w2.get(), |
| 439 aura::client::GetCaptureWindow(r2_w1->GetRootWindow())); | 439 aura::client::GetCaptureWindow(r2_w1->GetRootWindow())); |
| 440 generator2.MoveMouseBy(10, 10); | 440 generator2.MoveMouseBy(10, 10); |
| 441 generator2.ClickLeftButton(); | 441 generator2.ClickLeftButton(); |
| 442 EXPECT_EQ("0 0 0", r2_d1.GetMouseMotionCountsAndReset()); | 442 EXPECT_EQ("0 0 0", r2_d1.GetMouseMotionCountsAndReset()); |
| 443 EXPECT_EQ("0 0", r2_d1.GetMouseButtonCountsAndReset()); | 443 EXPECT_EQ("0 0", r2_d1.GetMouseButtonCountsAndReset()); |
| 444 // mouse is already entered. | 444 EXPECT_EQ("1 1 0", r1_d2.GetMouseMotionCountsAndReset()); |
| 445 EXPECT_EQ("0 1 0", r1_d2.GetMouseMotionCountsAndReset()); | |
| 446 EXPECT_EQ("1 1", r1_d2.GetMouseButtonCountsAndReset()); | 445 EXPECT_EQ("1 1", r1_d2.GetMouseButtonCountsAndReset()); |
| 447 r1_w2->ReleaseCapture(); | 446 r1_w2->ReleaseCapture(); |
| 448 EXPECT_EQ(NULL, aura::client::GetCaptureWindow(r2_w1->GetRootWindow())); | 447 EXPECT_EQ(NULL, aura::client::GetCaptureWindow(r2_w1->GetRootWindow())); |
| 449 generator2.MoveMouseTo(15, 15); | 448 generator2.MoveMouseTo(15, 15); |
| 450 generator2.ClickLeftButton(); | 449 generator2.ClickLeftButton(); |
| 451 EXPECT_EQ("1 1 0", r2_d1.GetMouseMotionCountsAndReset()); | 450 EXPECT_EQ("1 1 0", r2_d1.GetMouseMotionCountsAndReset()); |
| 452 EXPECT_EQ("1 1", r2_d1.GetMouseButtonCountsAndReset()); | 451 EXPECT_EQ("1 1", r2_d1.GetMouseButtonCountsAndReset()); |
| 453 // Make sure the mouse_moved_handler_ is properly reset. | 452 // Make sure the mouse_moved_handler_ is properly reset. |
| 454 EXPECT_EQ("0 0 0", r1_d2.GetMouseMotionCountsAndReset()); | 453 EXPECT_EQ("0 0 0", r1_d2.GetMouseMotionCountsAndReset()); |
| 455 EXPECT_EQ("0 0", r1_d2.GetMouseButtonCountsAndReset()); | 454 EXPECT_EQ("0 0", r1_d2.GetMouseButtonCountsAndReset()); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 generator.ReleaseLeftButton(); | 837 generator.ReleaseLeftButton(); |
| 839 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); | 838 EXPECT_EQ("-999,-999 -999,-999", event_handler.GetLocationsAndReset()); |
| 840 | 839 |
| 841 generator.MoveMouseTo(400, 150); | 840 generator.MoveMouseTo(400, 150); |
| 842 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); | 841 EXPECT_EQ("100,150 100,150", event_handler.GetLocationsAndReset()); |
| 843 | 842 |
| 844 ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler); | 843 ash::Shell::GetInstance()->RemovePreTargetHandler(&event_handler); |
| 845 } | 844 } |
| 846 | 845 |
| 847 } // namespace ash | 846 } // namespace ash |
| OLD | NEW |