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/display/display_manager.h" | 7 #include "ash/display/display_manager.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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 // Make sure that unified desktop can enter magnified mode. | 696 // Make sure that unified desktop can enter magnified mode. |
697 TEST_F(MagnificationControllerTest, EnableMagnifierInUnifiedDesktop) { | 697 TEST_F(MagnificationControllerTest, EnableMagnifierInUnifiedDesktop) { |
698 if (!SupportsMultipleDisplays()) | 698 if (!SupportsMultipleDisplays()) |
699 return; | 699 return; |
700 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true); | 700 Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true); |
701 | 701 |
702 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 702 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
703 | 703 |
704 GetMagnificationController()->SetEnabled(true); | 704 GetMagnificationController()->SetEnabled(true); |
705 | 705 |
706 gfx::Screen* screen = | 706 gfx::Screen* screen = gfx::Screen::GetScreen(); |
707 gfx::Screen::GetScreenFor(Shell::GetPrimaryRootWindow()); | |
708 | 707 |
709 UpdateDisplay("500x500, 500x500"); | 708 UpdateDisplay("500x500, 500x500"); |
710 EXPECT_EQ("0,0 1000x500", screen->GetPrimaryDisplay().bounds().ToString()); | 709 EXPECT_EQ("0,0 1000x500", screen->GetPrimaryDisplay().bounds().ToString()); |
711 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 710 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
712 | 711 |
713 GetMagnificationController()->SetEnabled(false); | 712 GetMagnificationController()->SetEnabled(false); |
714 | 713 |
715 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 714 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
716 | 715 |
717 GetMagnificationController()->SetEnabled(true); | 716 GetMagnificationController()->SetEnabled(true); |
718 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 717 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
719 | 718 |
720 UpdateDisplay("500x500"); | 719 UpdateDisplay("500x500"); |
721 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 720 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
722 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); | 721 EXPECT_EQ(2.0f, GetMagnificationController()->GetScale()); |
723 | 722 |
724 GetMagnificationController()->SetEnabled(false); | 723 GetMagnificationController()->SetEnabled(false); |
725 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); | 724 EXPECT_EQ("0,0 500x500", screen->GetPrimaryDisplay().bounds().ToString()); |
726 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); | 725 EXPECT_EQ(1.0f, GetMagnificationController()->GetScale()); |
727 } | 726 } |
728 | 727 |
729 } // namespace ash | 728 } // namespace ash |
OLD | NEW |