OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/views/mus/screen_mus.h" | 5 #include "ui/views/mus/screen_mus.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "ui/display/display_switches.h" | 8 #include "ui/display/display_switches.h" |
9 #include "ui/display/screen.h" | 9 #include "ui/display/screen.h" |
10 #include "ui/views/mus/window_manager_connection.h" | |
11 #include "ui/views/test/scoped_views_test_helper.h" | 10 #include "ui/views/test/scoped_views_test_helper.h" |
12 #include "ui/views/test/views_test_base.h" | 11 #include "ui/views/test/views_test_base.h" |
13 | 12 |
14 namespace views { | 13 namespace views { |
15 namespace { | 14 namespace { |
16 | 15 |
17 TEST(ScreenMusTest, ConsistentDisplayInHighDPI) { | 16 TEST(ScreenMusTest, ConsistentDisplayInHighDPI) { |
18 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); | 17 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); |
19 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 18 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
20 switches::kForceDeviceScaleFactor, "2"); | 19 switches::kForceDeviceScaleFactor, "2"); |
21 ScopedViewsTestHelper test_helper; | 20 ScopedViewsTestHelper test_helper; |
22 display::Screen* screen = display::Screen::GetScreen(); | 21 display::Screen* screen = display::Screen::GetScreen(); |
23 std::vector<display::Display> displays = screen->GetAllDisplays(); | 22 std::vector<display::Display> displays = screen->GetAllDisplays(); |
24 ASSERT_FALSE(displays.empty()); | 23 ASSERT_FALSE(displays.empty()); |
25 for (const display::Display& display : displays) { | 24 for (const display::Display& display : displays) { |
26 EXPECT_EQ(2.f, display.device_scale_factor()); | 25 EXPECT_EQ(2.f, display.device_scale_factor()); |
27 EXPECT_EQ(display.work_area(), display.bounds()); | 26 EXPECT_EQ(display.work_area(), display.bounds()); |
28 } | 27 } |
29 } | 28 } |
30 | 29 |
31 } // namespace | 30 } // namespace |
32 } // namespace views | 31 } // namespace views |
OLD | NEW |