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

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

Issue 2757493002: User orientation lock (Closed)
Patch Set: rebase again 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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
998 TEST_F(DisplayPreferencesTest, RotationLockTriggersStore) { 998 TEST_F(DisplayPreferencesTest, RotationLockTriggersStore) {
999 display::Display::SetInternalDisplayId( 999 display::Display::SetInternalDisplayId(
1000 display::Screen::GetScreen()->GetPrimaryDisplay().id()); 1000 display::Screen::GetScreen()->GetPrimaryDisplay().id());
1001 ASSERT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); 1001 ASSERT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock));
1002 1002
1003 ash::Shell::GetInstance()->screen_orientation_controller()->SetRotationLocked( 1003 ash::Shell::GetInstance()
1004 true); 1004 ->screen_orientation_controller()
1005 ->ToggleUserRotationLock();
1005 1006
1006 EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); 1007 EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock));
1007 1008
1008 const base::DictionaryValue* properties = 1009 const base::DictionaryValue* properties =
1009 local_state()->GetDictionary(prefs::kDisplayRotationLock); 1010 local_state()->GetDictionary(prefs::kDisplayRotationLock);
1010 bool rotation_lock; 1011 bool rotation_lock;
1011 EXPECT_TRUE(properties->GetBoolean("lock", &rotation_lock)); 1012 EXPECT_TRUE(properties->GetBoolean("lock", &rotation_lock));
1012 } 1013 }
1013 1014
1014 TEST_F(DisplayPreferencesTest, SaveUnifiedMode) { 1015 TEST_F(DisplayPreferencesTest, SaveUnifiedMode) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 1157
1157 EXPECT_EQ(gfx::Rect(0, 0, 200, 200), 1158 EXPECT_EQ(gfx::Rect(0, 0, 200, 200),
1158 display_manager()->GetDisplayForId(list[0]).bounds()); 1159 display_manager()->GetDisplayForId(list[0]).bounds());
1159 EXPECT_EQ(gfx::Rect(-200, 0, 200, 200), 1160 EXPECT_EQ(gfx::Rect(-200, 0, 200, 200),
1160 display_manager()->GetDisplayForId(list[1]).bounds()); 1161 display_manager()->GetDisplayForId(list[1]).bounds());
1161 EXPECT_EQ(gfx::Rect(-100, 200, 300, 300), 1162 EXPECT_EQ(gfx::Rect(-100, 200, 300, 300),
1162 display_manager()->GetDisplayForId(list[2]).bounds()); 1163 display_manager()->GetDisplayForId(list[2]).bounds());
1163 } 1164 }
1164 1165
1165 } // namespace chromeos 1166 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698