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

Side by Side Diff: chrome/browser/extensions/display_info_provider_chromeos_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
« no previous file with comments | « chrome/browser/chromeos/display/display_preferences_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api/system_display/display_info_provider.h" 5 #include "extensions/browser/api/system_display/display_info_provider.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 9 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
10 #include "ash/display/screen_orientation_controller_chromeos.h" 10 #include "ash/display/screen_orientation_controller_chromeos.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/test/ash_test_base.h" 12 #include "ash/test/ash_test_base.h"
13 #include "ash/test/screen_orientation_controller_test_api.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
17 #include "chrome/browser/extensions/display_info_provider_chromeos.h" 18 #include "chrome/browser/extensions/display_info_provider_chromeos.h"
18 #include "extensions/common/api/system_display.h" 19 #include "extensions/common/api/system_display.h"
19 #include "ui/display/display.h" 20 #include "ui/display/display.h"
20 #include "ui/display/display_layout.h" 21 #include "ui/display/display_layout.h"
21 #include "ui/display/display_switches.h" 22 #include "ui/display/display_switches.h"
22 #include "ui/display/manager/display_manager.h" 23 #include "ui/display/manager/display_manager.h"
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 922
922 // Entering maximize mode enables accelerometer screen rotations. 923 // Entering maximize mode enables accelerometer screen rotations.
923 ash::Shell::Get() 924 ash::Shell::Get()
924 ->maximize_mode_controller() 925 ->maximize_mode_controller()
925 ->EnableMaximizeModeWindowManager(true); 926 ->EnableMaximizeModeWindowManager(true);
926 // Rotation lock should not activate because DisplayInfoProvider::SetInfo() 927 // Rotation lock should not activate because DisplayInfoProvider::SetInfo()
927 // was called when not in maximize mode. 928 // was called when not in maximize mode.
928 EXPECT_FALSE(screen_orientation_controller->rotation_locked()); 929 EXPECT_FALSE(screen_orientation_controller->rotation_locked());
929 930
930 // ScreenOrientationController rotations override display info. 931 // ScreenOrientationController rotations override display info.
931 screen_orientation_controller->SetDisplayRotation( 932 ash::test::ScreenOrientationControllerTestApi test_api(
932 display::Display::ROTATE_0, display::Display::ROTATION_SOURCE_ACTIVE); 933 screen_orientation_controller);
934 test_api.SetDisplayRotation(display::Display::ROTATE_0,
935 display::Display::ROTATION_SOURCE_ACTIVE);
933 EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation()); 936 EXPECT_EQ(display::Display::ROTATE_0, GetCurrentInternalDisplayRotation());
934 937
935 // Exiting maximize mode should restore the initial rotation 938 // Exiting maximize mode should restore the initial rotation
936 ash::Shell::Get() 939 ash::Shell::Get()
937 ->maximize_mode_controller() 940 ->maximize_mode_controller()
938 ->EnableMaximizeModeWindowManager(false); 941 ->EnableMaximizeModeWindowManager(false);
939 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation()); 942 EXPECT_EQ(display::Display::ROTATE_90, GetCurrentInternalDisplayRotation());
940 } 943 }
941 944
942 // Tests that rotation changes made during maximize mode lock the display 945 // Tests that rotation changes made during maximize mode lock the display
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 EXPECT_EQ(pairs.pair1.touch_point.y, data.point_pairs[0].second.y()); 1443 EXPECT_EQ(pairs.pair1.touch_point.y, data.point_pairs[0].second.y());
1441 EXPECT_EQ(pairs.pair2.touch_point.y, data.point_pairs[1].second.y()); 1444 EXPECT_EQ(pairs.pair2.touch_point.y, data.point_pairs[1].second.y());
1442 EXPECT_EQ(pairs.pair3.touch_point.y, data.point_pairs[2].second.y()); 1445 EXPECT_EQ(pairs.pair3.touch_point.y, data.point_pairs[2].second.y());
1443 EXPECT_EQ(pairs.pair4.touch_point.y, data.point_pairs[3].second.y()); 1446 EXPECT_EQ(pairs.pair4.touch_point.y, data.point_pairs[3].second.y());
1444 1447
1445 EXPECT_EQ(bounds.width, data.bounds.width()); 1448 EXPECT_EQ(bounds.width, data.bounds.width());
1446 EXPECT_EQ(bounds.height, data.bounds.height()); 1449 EXPECT_EQ(bounds.height, data.bounds.height());
1447 } 1450 }
1448 } // namespace 1451 } // namespace
1449 } // namespace extensions 1452 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/display/display_preferences_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698