| 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 "ash/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_types.h" | 7 #include "ash/accessibility_types.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 693 |
| 694 UpdateDisplay("500x500"); | 694 UpdateDisplay("500x500"); |
| 695 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 695 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
| 696 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 696 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
| 697 | 697 |
| 698 GetMagnificationController()->SetEnabled(false); | 698 GetMagnificationController()->SetEnabled(false); |
| 699 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 699 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
| 700 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 700 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
| 701 } | 701 } |
| 702 | 702 |
| 703 // Make sure that mouse can move across display in magnified mode. |
| 704 TEST_F(MagnificationControllerTest, MoveMouseToSecondDisplay) { |
| 705 UpdateDisplay("0+0-500x500, 500+0-500x500"); |
| 706 EXPECT_EQ(2ul, display::Screen::GetScreen()->GetAllDisplays().size()); |
| 707 |
| 708 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 709 |
| 710 GetEventGenerator().MoveMouseTo(gfx::Point(250, 250)); |
| 711 EXPECT_TRUE(root_windows[1]->layer()->transform().IsIdentity()); |
| 712 EXPECT_TRUE(root_windows[0]->layer()->transform().IsIdentity()); |
| 713 |
| 714 GetMagnificationController()->SetEnabled(true); |
| 715 EXPECT_FALSE(root_windows[0]->layer()->transform().IsIdentity()); |
| 716 EXPECT_TRUE(root_windows[1]->layer()->transform().IsIdentity()); |
| 717 |
| 718 GetEventGenerator().MoveMouseTo(gfx::Point(750, 250)); |
| 719 EXPECT_FALSE(root_windows[1]->layer()->transform().IsIdentity()); |
| 720 EXPECT_TRUE(root_windows[0]->layer()->transform().IsIdentity()); |
| 721 |
| 722 GetMagnificationController()->SetEnabled(false); |
| 723 EXPECT_TRUE(root_windows[1]->layer()->transform().IsIdentity()); |
| 724 EXPECT_TRUE(root_windows[0]->layer()->transform().IsIdentity()); |
| 725 } |
| 726 |
| 703 } // namespace ash | 727 } // namespace ash |
| OLD | NEW |