| Index: chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc b/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
|
| index faf4c46897104be67cdcb393610e0271633d3026..0ad7f41488650250c9f7a6bbebdef14839dff1d1 100644
|
| --- a/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
|
| +++ b/chrome/browser/chromeos/policy/display_rotation_default_handler_browsertest.cc
|
| @@ -32,8 +32,8 @@
|
| #include "chromeos/settings/cros_settings_names.h"
|
| #include "content/public/test/test_utils.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| +#include "ui/display/display.h"
|
| #include "ui/display/manager/display_layout.h"
|
| -#include "ui/gfx/display.h"
|
|
|
| namespace em = enterprise_management;
|
|
|
| @@ -43,25 +43,25 @@ ash::DisplayManager* GetDisplayManager() {
|
| return ash::Shell::GetInstance()->display_manager();
|
| }
|
|
|
| -gfx::Display::Rotation GetRotationOfFirstDisplay() {
|
| +display::Display::Rotation GetRotationOfFirstDisplay() {
|
| const ash::DisplayManager* const display_manager = GetDisplayManager();
|
| const int64_t first_display_id = display_manager->first_display_id();
|
| - const gfx::Display& first_display =
|
| + const display::Display& first_display =
|
| display_manager->GetDisplayForId(first_display_id);
|
| return first_display.rotation();
|
| }
|
|
|
| // Fails the test and returns ROTATE_0 if there is no second display.
|
| -gfx::Display::Rotation GetRotationOfSecondDisplay() {
|
| +display::Display::Rotation GetRotationOfSecondDisplay() {
|
| const ash::DisplayManager* const display_manager = GetDisplayManager();
|
| if (display_manager->GetNumDisplays() < 2) {
|
| ADD_FAILURE()
|
| << "Requested rotation of second display while there was only one.";
|
| - return gfx::Display::ROTATE_0;
|
| + return display::Display::ROTATE_0;
|
| }
|
| const display::DisplayIdList display_id_pair =
|
| display_manager->GetCurrentDisplayIdList();
|
| - const gfx::Display& second_display =
|
| + const display::Display& second_display =
|
| display_manager->GetDisplayForId(display_id_pair[1]);
|
| return second_display.rotation();
|
| }
|
| @@ -72,7 +72,7 @@ namespace policy {
|
|
|
| class DisplayRotationDefaultTest
|
| : public policy::DevicePolicyCrosBrowserTest,
|
| - public testing::WithParamInterface<gfx::Display::Rotation> {
|
| + public testing::WithParamInterface<display::Display::Rotation> {
|
| public:
|
| DisplayRotationDefaultTest() {}
|
|
|
| @@ -144,7 +144,7 @@ class DisplayRotationDefaultTest
|
| DISALLOW_COPY_AND_ASSIGN(DisplayRotationDefaultTest);
|
| };
|
|
|
| -// If gfx::Display::Rotation is ever modified and this test fails, there are
|
| +// If display::Display::Rotation is ever modified and this test fails, there are
|
| // hardcoded enum-values in the following files that might need adjustment:
|
| // * this file: range check in this function, initializations, expected values,
|
| // the list of parameters at the bottom of the file
|
| @@ -154,10 +154,10 @@ class DisplayRotationDefaultTest
|
| // * chrome/browser/chromeos/policy/proto/chrome_device_policy.proto:
|
| // DisplayRotationDefaultProto::Rotation should match one to one
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, EnumsInSync) {
|
| - const gfx::Display::Rotation rotation = GetParam();
|
| + const display::Display::Rotation rotation = GetParam();
|
| EXPECT_EQ(em::DisplayRotationDefaultProto::Rotation_ARRAYSIZE,
|
| - gfx::Display::ROTATE_270 + 1)
|
| - << "Enums gfx::Display::Rotation and "
|
| + display::Display::ROTATE_270 + 1)
|
| + << "Enums display::Display::Rotation and "
|
| << "em::DisplayRotationDefaultProto::Rotation are not in sync.";
|
| EXPECT_TRUE(em::DisplayRotationDefaultProto::Rotation_IsValid(rotation))
|
| << rotation << " is invalid as rotation. All valid values lie in "
|
| @@ -166,8 +166,8 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, EnumsInSync) {
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, FirstDisplay) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| - EXPECT_EQ(gfx::Display::ROTATE_0, GetRotationOfFirstDisplay())
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| + EXPECT_EQ(display::Display::ROTATE_0, GetRotationOfFirstDisplay())
|
| << "Initial primary rotation before policy";
|
|
|
| SetPolicy(policy_rotation);
|
| @@ -181,9 +181,9 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, FirstDisplay) {
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, RefreshSecondDisplay) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| ToggleSecondDisplay();
|
| - EXPECT_EQ(gfx::Display::ROTATE_0, GetRotationOfSecondDisplay())
|
| + EXPECT_EQ(display::Display::ROTATE_0, GetRotationOfSecondDisplay())
|
| << "Rotation of secondary display before policy";
|
| SetPolicy(policy_rotation);
|
| EXPECT_EQ(policy_rotation, GetRotationOfSecondDisplay())
|
| @@ -191,7 +191,7 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, RefreshSecondDisplay) {
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, ConnectSecondDisplay) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| SetPolicy(policy_rotation);
|
| ToggleSecondDisplay();
|
| EXPECT_EQ(policy_rotation, GetRotationOfFirstDisplay())
|
| @@ -201,11 +201,11 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, ConnectSecondDisplay) {
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, UserInteraction) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| - const gfx::Display::Rotation user_rotation = gfx::Display::ROTATE_90;
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation user_rotation = display::Display::ROTATE_90;
|
| GetDisplayManager()->SetDisplayRotation(
|
| GetDisplayManager()->first_display_id(), user_rotation,
|
| - gfx::Display::ROTATION_SOURCE_USER);
|
| + display::Display::ROTATION_SOURCE_USER);
|
| EXPECT_EQ(user_rotation, GetRotationOfFirstDisplay())
|
| << "Rotation of primary display after user change";
|
| SetPolicy(policy_rotation);
|
| @@ -213,7 +213,7 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, UserInteraction) {
|
| << "Rotation of primary display after policy overrode user change";
|
| GetDisplayManager()->SetDisplayRotation(
|
| GetDisplayManager()->first_display_id(), user_rotation,
|
| - gfx::Display::ROTATION_SOURCE_USER);
|
| + display::Display::ROTATION_SOURCE_USER);
|
| EXPECT_EQ(user_rotation, GetRotationOfFirstDisplay())
|
| << "Rotation of primary display after user overrode policy change";
|
| SetADifferentPolicy();
|
| @@ -222,7 +222,7 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, UserInteraction) {
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, SetAndUnsetPolicy) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| SetPolicy(policy_rotation);
|
| UnsetPolicy();
|
| EXPECT_EQ(policy_rotation, GetRotationOfFirstDisplay())
|
| @@ -231,12 +231,12 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest, SetAndUnsetPolicy) {
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest,
|
| SetAndUnsetPolicyWithUserInteraction) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| - const gfx::Display::Rotation user_rotation = gfx::Display::ROTATE_90;
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation user_rotation = display::Display::ROTATE_90;
|
| SetPolicy(policy_rotation);
|
| GetDisplayManager()->SetDisplayRotation(
|
| GetDisplayManager()->first_display_id(), user_rotation,
|
| - gfx::Display::ROTATION_SOURCE_USER);
|
| + display::Display::ROTATION_SOURCE_USER);
|
| UnsetPolicy();
|
| EXPECT_EQ(user_rotation, GetRotationOfFirstDisplay())
|
| << "Rotation of primary display after policy was set to "
|
| @@ -246,10 +246,10 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationDefaultTest,
|
|
|
| INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault,
|
| DisplayRotationDefaultTest,
|
| - testing::Values(gfx::Display::ROTATE_0,
|
| - gfx::Display::ROTATE_90,
|
| - gfx::Display::ROTATE_180,
|
| - gfx::Display::ROTATE_270));
|
| + testing::Values(display::Display::ROTATE_0,
|
| + display::Display::ROTATE_90,
|
| + display::Display::ROTATE_180,
|
| + display::Display::ROTATE_270));
|
|
|
| // This class tests that the policy is reapplied after a reboot. To persist from
|
| // PRE_Reboot to Reboot, the policy is inserted into a FakeSessionManagerClient.
|
| @@ -260,7 +260,7 @@ INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault,
|
| // device_settings_cache::Retrieve()).
|
| class DisplayRotationBootTest
|
| : public InProcessBrowserTest,
|
| - public testing::WithParamInterface<gfx::Display::Rotation> {
|
| + public testing::WithParamInterface<display::Display::Rotation> {
|
| protected:
|
| DisplayRotationBootTest()
|
| : fake_session_manager_client_(new chromeos::FakeSessionManagerClient) {}
|
| @@ -283,8 +283,8 @@ class DisplayRotationBootTest
|
| };
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationBootTest, PRE_Reboot) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| - const gfx::Display::Rotation user_rotation = gfx::Display::ROTATE_180;
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation user_rotation = display::Display::ROTATE_180;
|
|
|
| // Set policy.
|
| policy::DevicePolicyBuilder* const device_policy(
|
| @@ -305,19 +305,19 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationBootTest, PRE_Reboot) {
|
| // Check the display's rotation.
|
| ash::DisplayManager* const display_manager = GetDisplayManager();
|
| const int64_t first_display_id = display_manager->first_display_id();
|
| - const gfx::Display& first_display =
|
| + const display::Display& first_display =
|
| display_manager->GetDisplayForId(first_display_id);
|
| EXPECT_EQ(policy_rotation, first_display.rotation());
|
|
|
| // Let the user rotate the display to a different orientation, to check that
|
| // the policy value is restored after reboot.
|
| display_manager->SetDisplayRotation(first_display_id, user_rotation,
|
| - gfx::Display::ROTATION_SOURCE_USER);
|
| + display::Display::ROTATION_SOURCE_USER);
|
| EXPECT_EQ(user_rotation, first_display.rotation());
|
| }
|
|
|
| IN_PROC_BROWSER_TEST_P(DisplayRotationBootTest, Reboot) {
|
| - const gfx::Display::Rotation policy_rotation = GetParam();
|
| + const display::Display::Rotation policy_rotation = GetParam();
|
|
|
| // Check that the policy rotation is restored.
|
| EXPECT_EQ(policy_rotation, GetRotationOfFirstDisplay());
|
| @@ -325,9 +325,9 @@ IN_PROC_BROWSER_TEST_P(DisplayRotationBootTest, Reboot) {
|
|
|
| INSTANTIATE_TEST_CASE_P(PolicyDisplayRotationDefault,
|
| DisplayRotationBootTest,
|
| - testing::Values(gfx::Display::ROTATE_0,
|
| - gfx::Display::ROTATE_90,
|
| - gfx::Display::ROTATE_180,
|
| - gfx::Display::ROTATE_270));
|
| + testing::Values(display::Display::ROTATE_0,
|
| + display::Display::ROTATE_90,
|
| + display::Display::ROTATE_180,
|
| + display::Display::ROTATE_270));
|
|
|
| } // namespace policy
|
|
|