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

Unified Diff: ash/display/root_window_transformers_unittest.cc

Issue 1108343002: Revert of Merge Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/root_window_transformers.cc ('k') | ash/rotator/screen_rotation_animator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/root_window_transformers_unittest.cc
diff --git a/ash/display/root_window_transformers_unittest.cc b/ash/display/root_window_transformers_unittest.cc
index 6639ec943add2d994bbfebb40bfdaf88952a06ff..17c8b36310e3d59d67d6be122950ccd361f4370f 100644
--- a/ash/display/root_window_transformers_unittest.cc
+++ b/ash/display/root_window_transformers_unittest.cc
@@ -107,6 +107,10 @@
DISALLOW_COPY_AND_ASSIGN(TestEventHandler);
};
+gfx::Display::Rotation GetStoredRotation(int64 id) {
+ return Shell::GetInstance()->display_manager()->GetDisplayInfo(id).rotation();
+}
+
float GetStoredUIScale(int64 id) {
return Shell::GetInstance()->display_manager()->GetDisplayInfo(id).
GetEffectiveUIScale();
@@ -154,12 +158,12 @@
EXPECT_EQ("50,90", event_handler.GetLocationAndReset());
EXPECT_EQ("50,90",
aura::Env::GetInstance()->last_mouse_location().ToString());
- EXPECT_EQ(gfx::Display::ROTATE_0, GetActiveDisplayRotation(display1.id()));
- EXPECT_EQ(gfx::Display::ROTATE_0, GetActiveDisplayRotation(display2_id));
- magnifier->SetEnabled(false);
-
- display_manager->SetDisplayRotation(display1.id(), gfx::Display::ROTATE_90,
- gfx::Display::ROTATION_SOURCE_ACTIVE);
+ EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display1.id()));
+ EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display2_id));
+ magnifier->SetEnabled(false);
+
+ display_manager->SetDisplayRotation(display1.id(),
+ gfx::Display::ROTATE_90);
// Move the cursor to the center of the first root window.
generator1.MoveMouseToInHost(59, 100);
@@ -173,8 +177,8 @@
EXPECT_EQ("110,70", event_handler.GetLocationAndReset());
EXPECT_EQ("110,70",
aura::Env::GetInstance()->last_mouse_location().ToString());
- EXPECT_EQ(gfx::Display::ROTATE_90, GetActiveDisplayRotation(display1.id()));
- EXPECT_EQ(gfx::Display::ROTATE_0, GetActiveDisplayRotation(display2_id));
+ EXPECT_EQ(gfx::Display::ROTATE_90, GetStoredRotation(display1.id()));
+ EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display2_id));
magnifier->SetEnabled(false);
DisplayLayout display_layout(DisplayLayout::BOTTOM, 50);
@@ -182,8 +186,8 @@
EXPECT_EQ("50,120 150x200",
ScreenUtil::GetSecondaryDisplay().bounds().ToString());
- display_manager->SetDisplayRotation(display2_id, gfx::Display::ROTATE_270,
- gfx::Display::ROTATION_SOURCE_ACTIVE);
+ display_manager->SetDisplayRotation(display2_id,
+ gfx::Display::ROTATE_270);
// Move the cursor to the center of the second root window.
generator2.MoveMouseToInHost(151, 199);
@@ -196,12 +200,12 @@
EXPECT_EQ("95,80", event_handler.GetLocationAndReset());
EXPECT_EQ("145,200",
aura::Env::GetInstance()->last_mouse_location().ToString());
- EXPECT_EQ(gfx::Display::ROTATE_90, GetActiveDisplayRotation(display1.id()));
- EXPECT_EQ(gfx::Display::ROTATE_270, GetActiveDisplayRotation(display2_id));
- magnifier->SetEnabled(false);
-
- display_manager->SetDisplayRotation(display1.id(), gfx::Display::ROTATE_180,
- gfx::Display::ROTATION_SOURCE_ACTIVE);
+ EXPECT_EQ(gfx::Display::ROTATE_90, GetStoredRotation(display1.id()));
+ EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id));
+ magnifier->SetEnabled(false);
+
+ display_manager->SetDisplayRotation(display1.id(),
+ gfx::Display::ROTATE_180);
// Move the cursor to the center of the first root window.
generator1.MoveMouseToInHost(59, 99);
@@ -213,8 +217,8 @@
ScreenUtil::GetSecondaryDisplay().bounds().ToString());
generator1.MoveMouseToInHost(39, 59);
EXPECT_EQ("70,120", event_handler.GetLocationAndReset());
- EXPECT_EQ(gfx::Display::ROTATE_180, GetActiveDisplayRotation(display1.id()));
- EXPECT_EQ(gfx::Display::ROTATE_270, GetActiveDisplayRotation(display2_id));
+ EXPECT_EQ(gfx::Display::ROTATE_180, GetStoredRotation(display1.id()));
+ EXPECT_EQ(gfx::Display::ROTATE_270, GetStoredRotation(display2_id));
magnifier->SetEnabled(false);
Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
« no previous file with comments | « ash/display/root_window_transformers.cc ('k') | ash/rotator/screen_rotation_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698