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

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

Issue 2886843004: Fix jittering cursor in screen magnifier mode (Closed)
Patch Set: Fix unstable cursor in dual-display magnified mode Created 3 years, 7 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/magnifier/magnification_controller.cc ('k') | no next file » | 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/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
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
OLDNEW
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698