Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: ash/magnifier/magnification_controller_unittest.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/host/ash_window_tree_host_x11.cc ('k') | ash/shelf/shelf_widget_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/host/ash_window_tree_host_x11.cc ('k') | ash/shelf/shelf_widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698