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

Side by Side Diff: ash/ash_root_window_transformer_unittest.cc

Issue 14466005: Magnifier: Prevent the cursor jumping on HiDPI display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & use aura::test::EventGenerator::MoveMouseToInHost Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller.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/ash_root_window_transformer.h" 5 #include"ash/ash_root_window_transformer.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_info.h" 8 #include "ash/display/display_info.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/launcher/launcher.h" 10 #include "ash/launcher/launcher.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // Move the cursor to the center of the second root window. 196 // Move the cursor to the center of the second root window.
197 generator2.MoveMouseToInHost(151, 199); 197 generator2.MoveMouseToInHost(151, 199);
198 198
199 magnifier->SetEnabled(true); 199 magnifier->SetEnabled(true);
200 EXPECT_EQ("200x120", root_windows[0]->bounds().size().ToString()); 200 EXPECT_EQ("200x120", root_windows[0]->bounds().size().ToString());
201 EXPECT_EQ("200x150", root_windows[1]->bounds().size().ToString()); 201 EXPECT_EQ("200x150", root_windows[1]->bounds().size().ToString());
202 EXPECT_EQ("50,120 200x150", 202 EXPECT_EQ("50,120 200x150",
203 ScreenAsh::GetSecondaryDisplay().bounds().ToString()); 203 ScreenAsh::GetSecondaryDisplay().bounds().ToString());
204 generator2.MoveMouseToInHost(172, 219); 204 generator2.MoveMouseToInHost(172, 219);
205 EXPECT_EQ("95,80", event_handler.GetLocationAndReset()); 205 EXPECT_EQ("95,80", event_handler.GetLocationAndReset());
206 EXPECT_EQ("169,175", 206 EXPECT_EQ("145,200",
207 aura::Env::GetInstance()->last_mouse_location().ToString()); 207 aura::Env::GetInstance()->last_mouse_location().ToString());
208 EXPECT_EQ(gfx::Display::ROTATE_90, GetStoredRotation(display1.id())); 208 EXPECT_EQ(gfx::Display::ROTATE_90, GetStoredRotation(display1.id()));
209 EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id)); 209 EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id));
210 magnifier->SetEnabled(false); 210 magnifier->SetEnabled(false);
211 211
212 display_manager->SetDisplayRotation(display1.id(), 212 display_manager->SetDisplayRotation(display1.id(),
213 gfx::Display::ROTATE_180); 213 gfx::Display::ROTATE_180);
214 // Move the cursor to the center of the first root window. 214 // Move the cursor to the center of the first root window.
215 generator1.MoveMouseToInHost(59, 99); 215 generator1.MoveMouseToInHost(59, 99);
216 216
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 EXPECT_EQ("159,99", event_handler.GetLocationAndReset()); 389 EXPECT_EQ("159,99", event_handler.GetLocationAndReset());
390 390
391 magnifier->SetEnabled(false); 391 magnifier->SetEnabled(false);
392 EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale()); 392 EXPECT_FLOAT_EQ(1.0f, magnifier->GetScale());
393 393
394 Shell::GetInstance()->RemovePreTargetHandler(&event_handler); 394 Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
395 } 395 }
396 396
397 } // namespace test 397 } // namespace test
398 } // namespace ash 398 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698