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

Unified Diff: ash/display/display_controller_unittest.cc

Issue 289583002: Lock rotation when screen is manually rotated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Define sources for rotation Created 6 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/display_controller_unittest.cc
diff --git a/ash/display/display_controller_unittest.cc b/ash/display/display_controller_unittest.cc
index 95b7af6a420bb498b002c3b60c3447254771e75d..c0889ab08c889532dbcd5f0c1784894a04e28a8a 100644
--- a/ash/display/display_controller_unittest.cc
+++ b/ash/display/display_controller_unittest.cc
@@ -26,6 +26,7 @@
#include "ui/aura/test/event_generator.h"
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
+#include "ui/display/types/display_constants.h"
#include "ui/events/event_handler.h"
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
@@ -628,11 +629,14 @@ TEST_F(DisplayControllerTest, BoundsUpdated) {
// Rotation
int64 primary_id = GetPrimaryDisplay().id();
- display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90);
+ display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90,
+ ui::USER);
EXPECT_EQ(1, observer.CountAndReset());
EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
EXPECT_EQ(0, observer.GetActivationChangedCountAndReset());
- display_manager->SetDisplayRotation(primary_id, gfx::Display::ROTATE_90);
+ display_manager->SetDisplayRotation(primary_id,
+ gfx::Display::ROTATE_90,
+ ui::USER);
EXPECT_EQ(0, observer.CountAndReset());
EXPECT_EQ(0, observer.GetFocusChangedCountAndReset());
EXPECT_EQ(0, observer.GetActivationChangedCountAndReset());
@@ -1042,7 +1046,8 @@ TEST_F(DisplayControllerTest, Rotate) {
EXPECT_EQ(gfx::Display::ROTATE_0, GetStoredRotation(display2_id));
display_manager->SetDisplayRotation(display1.id(),
- gfx::Display::ROTATE_90);
+ gfx::Display::ROTATE_90,
+ ui::USER);
EXPECT_EQ("200x120", root_windows[0]->bounds().size().ToString());
EXPECT_EQ("150x200", root_windows[1]->bounds().size().ToString());
EXPECT_EQ("200,0 150x200",
@@ -1058,7 +1063,8 @@ TEST_F(DisplayControllerTest, Rotate) {
ScreenUtil::GetSecondaryDisplay().bounds().ToString());
display_manager->SetDisplayRotation(display2_id,
- gfx::Display::ROTATE_270);
+ gfx::Display::ROTATE_270,
+ ui::USER);
EXPECT_EQ("200x120", root_windows[0]->bounds().size().ToString());
EXPECT_EQ("200x150", root_windows[1]->bounds().size().ToString());
EXPECT_EQ("50,120 200x150",
@@ -1071,7 +1077,8 @@ TEST_F(DisplayControllerTest, Rotate) {
generator2.MoveMouseToInHost(50, 40);
EXPECT_EQ("179,25", event_handler.GetLocationAndReset());
display_manager->SetDisplayRotation(display1.id(),
- gfx::Display::ROTATE_180);
+ gfx::Display::ROTATE_180,
+ ui::USER);
EXPECT_EQ("120x200", root_windows[0]->bounds().size().ToString());
EXPECT_EQ("200x150", root_windows[1]->bounds().size().ToString());
@@ -1224,7 +1231,7 @@ DisplayInfo CreateDisplayInfo(int64 id,
gfx::Display::Rotation rotation) {
DisplayInfo info(id, "", false);
info.SetBounds(gfx::Rect(0, y, 500, 500));
- info.set_rotation(rotation);
+ info.SetRotation(rotation, ui::USER);
return info;
}

Powered by Google App Engine
This is Rietveld 408576698