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

Side by Side Diff: chrome/browser/chromeos/display/display_preferences_unittest.cc

Issue 2766543002: Move even more from WmShell to Shell (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/display/display_preferences.h" 5 #include "chrome/browser/chromeos/display/display_preferences.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 display::Display::ROTATE_0, 832 display::Display::ROTATE_0,
833 display::Display::ROTATION_SOURCE_USER); 833 display::Display::ROTATION_SOURCE_USER);
834 834
835 // Open up 270 degrees to trigger maximize mode 835 // Open up 270 degrees to trigger maximize mode
836 scoped_refptr<chromeos::AccelerometerUpdate> update( 836 scoped_refptr<chromeos::AccelerometerUpdate> update(
837 new chromeos::AccelerometerUpdate()); 837 new chromeos::AccelerometerUpdate());
838 update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f, 838 update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f,
839 kMeanGravity); 839 kMeanGravity);
840 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f); 840 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f);
841 ash::MaximizeModeController* controller = 841 ash::MaximizeModeController* controller =
842 ash::WmShell::Get()->maximize_mode_controller(); 842 ash::Shell::Get()->maximize_mode_controller();
843 controller->OnAccelerometerUpdated(update); 843 controller->OnAccelerometerUpdated(update);
844 EXPECT_TRUE(controller->IsMaximizeModeWindowManagerEnabled()); 844 EXPECT_TRUE(controller->IsMaximizeModeWindowManagerEnabled());
845 845
846 // Trigger 90 degree rotation 846 // Trigger 90 degree rotation
847 update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, -kMeanGravity, 847 update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, -kMeanGravity,
848 0.0f, 0.0f); 848 0.0f, 0.0f);
849 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, -kMeanGravity, 0.0f, 0.0f); 849 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, -kMeanGravity, 0.0f, 0.0f);
850 controller->OnAccelerometerUpdated(update); 850 controller->OnAccelerometerUpdated(update);
851 shell->screen_orientation_controller()->OnAccelerometerUpdated(update); 851 shell->screen_orientation_controller()->OnAccelerometerUpdated(update);
852 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); 852 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 EXPECT_FALSE(rotation_lock); 977 EXPECT_FALSE(rotation_lock);
978 EXPECT_EQ(display::Display::ROTATE_0, before_maximize_mode_rotation); 978 EXPECT_EQ(display::Display::ROTATE_0, before_maximize_mode_rotation);
979 979
980 // Open up 270 degrees to trigger maximize mode 980 // Open up 270 degrees to trigger maximize mode
981 scoped_refptr<chromeos::AccelerometerUpdate> update( 981 scoped_refptr<chromeos::AccelerometerUpdate> update(
982 new chromeos::AccelerometerUpdate()); 982 new chromeos::AccelerometerUpdate());
983 update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f, 983 update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f,
984 kMeanGravity); 984 kMeanGravity);
985 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f); 985 update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f);
986 ash::MaximizeModeController* maximize_mode_controller = 986 ash::MaximizeModeController* maximize_mode_controller =
987 ash::WmShell::Get()->maximize_mode_controller(); 987 ash::Shell::Get()->maximize_mode_controller();
988 maximize_mode_controller->OnAccelerometerUpdated(update); 988 maximize_mode_controller->OnAccelerometerUpdated(update);
989 EXPECT_TRUE(maximize_mode_controller->IsMaximizeModeWindowManagerEnabled()); 989 EXPECT_TRUE(maximize_mode_controller->IsMaximizeModeWindowManagerEnabled());
990 bool screen_orientation_rotation_lock = IsRotationLocked(); 990 bool screen_orientation_rotation_lock = IsRotationLocked();
991 display::Display::Rotation maximize_mode_rotation = 991 display::Display::Rotation maximize_mode_rotation =
992 GetCurrentInternalDisplayRotation(); 992 GetCurrentInternalDisplayRotation();
993 EXPECT_TRUE(screen_orientation_rotation_lock); 993 EXPECT_TRUE(screen_orientation_rotation_lock);
994 EXPECT_EQ(display::Display::ROTATE_90, maximize_mode_rotation); 994 EXPECT_EQ(display::Display::ROTATE_90, maximize_mode_rotation);
995 } 995 }
996 996
997 // Tests that rotation lock being set causes the rotation state to be saved. 997 // Tests that rotation lock being set causes the rotation state to be saved.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 1156
1157 EXPECT_EQ(gfx::Rect(0, 0, 200, 200), 1157 EXPECT_EQ(gfx::Rect(0, 0, 200, 200),
1158 display_manager()->GetDisplayForId(list[0]).bounds()); 1158 display_manager()->GetDisplayForId(list[0]).bounds());
1159 EXPECT_EQ(gfx::Rect(-200, 0, 200, 200), 1159 EXPECT_EQ(gfx::Rect(-200, 0, 200, 200),
1160 display_manager()->GetDisplayForId(list[1]).bounds()); 1160 display_manager()->GetDisplayForId(list[1]).bounds());
1161 EXPECT_EQ(gfx::Rect(-100, 200, 300, 300), 1161 EXPECT_EQ(gfx::Rect(-100, 200, 300, 300),
1162 display_manager()->GetDisplayForId(list[2]).bounds()); 1162 display_manager()->GetDisplayForId(list[2]).bounds());
1163 } 1163 }
1164 1164
1165 } // namespace chromeos 1165 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/wm/power_button_controller.cc ('k') | chrome/browser/chromeos/extensions/wallpaper_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698