| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/gfx/screen_win.h" | 5 #include "ui/gfx/screen_win.h" |
| 6 | 6 |
| 7 #include <cwchar> | 7 #include <cwchar> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 TEST_F(ScreenWinTest, SingleDisplay1x) { | 51 TEST_F(ScreenWinTest, SingleDisplay1x) { |
| 52 std::vector<MONITORINFOEX> monitor_infos; | 52 std::vector<MONITORINFOEX> monitor_infos; |
| 53 monitor_infos.push_back(CreateMonitorInfo(gfx::Rect(0, 0, 1920, 1200), | 53 monitor_infos.push_back(CreateMonitorInfo(gfx::Rect(0, 0, 1920, 1200), |
| 54 gfx::Rect(0, 0, 1920, 1100), | 54 gfx::Rect(0, 0, 1920, 1100), |
| 55 L"primary")); | 55 L"primary")); |
| 56 std::vector<gfx::Display> displays = | 56 std::vector<gfx::Display> displays = |
| 57 ScreenWin::GetDisplaysForMonitorInfos(monitor_infos); | 57 ScreenWin::GetDisplaysForMonitorInfos(monitor_infos); |
| 58 | 58 |
| 59 ASSERT_EQ(1, displays.size()); | 59 ASSERT_EQ(1u, displays.size()); |
| 60 EXPECT_EQ(gfx::Rect(0, 0, 1920, 1200), displays[0].bounds()); | 60 EXPECT_EQ(gfx::Rect(0, 0, 1920, 1200), displays[0].bounds()); |
| 61 EXPECT_EQ(gfx::Rect(0, 0, 1920, 1100), displays[0].work_area()); | 61 EXPECT_EQ(gfx::Rect(0, 0, 1920, 1100), displays[0].work_area()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 TEST_F(ScreenWinTest, SingleDisplay2x) { | 64 TEST_F(ScreenWinTest, SingleDisplay2x) { |
| 65 gfx::InitDeviceScaleFactor(2.0); | 65 gfx::InitDeviceScaleFactor(2.0); |
| 66 | 66 |
| 67 std::vector<MONITORINFOEX> monitor_infos; | 67 std::vector<MONITORINFOEX> monitor_infos; |
| 68 monitor_infos.push_back(CreateMonitorInfo(gfx::Rect(0, 0, 1920, 1200), | 68 monitor_infos.push_back(CreateMonitorInfo(gfx::Rect(0, 0, 1920, 1200), |
| 69 gfx::Rect(0, 0, 1920, 1100), | 69 gfx::Rect(0, 0, 1920, 1100), |
| 70 L"primary")); | 70 L"primary")); |
| 71 std::vector<gfx::Display> displays = | 71 std::vector<gfx::Display> displays = |
| 72 ScreenWin::GetDisplaysForMonitorInfos(monitor_infos); | 72 ScreenWin::GetDisplaysForMonitorInfos(monitor_infos); |
| 73 | 73 |
| 74 ASSERT_EQ(1, displays.size()); | 74 ASSERT_EQ(1u, displays.size()); |
| 75 EXPECT_EQ(gfx::Rect(0, 0, 960, 600), displays[0].bounds()); | 75 EXPECT_EQ(gfx::Rect(0, 0, 960, 600), displays[0].bounds()); |
| 76 EXPECT_EQ(gfx::Rect(0, 0, 960, 550), displays[0].work_area()); | 76 EXPECT_EQ(gfx::Rect(0, 0, 960, 550), displays[0].work_area()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace gfx | 79 } // namespace gfx |
| OLD | NEW |