OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/display/display_info.h" | 5 #include "ash/display/display_info.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace ash { | 9 namespace ash { |
10 namespace { | 10 namespace { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 EXPECT_EQ("1920x1275", GetModeSizeInDIP(size, 2.0f, 1.5f, true)); | 103 EXPECT_EQ("1920x1275", GetModeSizeInDIP(size, 2.0f, 1.5f, true)); |
104 EXPECT_EQ("1600x1062", GetModeSizeInDIP(size, 2.0f, 1.25f, true)); | 104 EXPECT_EQ("1600x1062", GetModeSizeInDIP(size, 2.0f, 1.25f, true)); |
105 EXPECT_EQ("1440x956", GetModeSizeInDIP(size, 2.0f, 1.125f, true)); | 105 EXPECT_EQ("1440x956", GetModeSizeInDIP(size, 2.0f, 1.125f, true)); |
106 EXPECT_EQ("1280x850", GetModeSizeInDIP(size, 2.0f, 1.0f, true)); | 106 EXPECT_EQ("1280x850", GetModeSizeInDIP(size, 2.0f, 1.0f, true)); |
107 EXPECT_EQ("1024x680", GetModeSizeInDIP(size, 2.0f, 0.8f, true)); | 107 EXPECT_EQ("1024x680", GetModeSizeInDIP(size, 2.0f, 0.8f, true)); |
108 EXPECT_EQ("800x531", GetModeSizeInDIP(size, 2.0f, 0.625f, true)); | 108 EXPECT_EQ("800x531", GetModeSizeInDIP(size, 2.0f, 0.625f, true)); |
109 EXPECT_EQ("640x425", GetModeSizeInDIP(size, 2.0f, 0.5f, true)); | 109 EXPECT_EQ("640x425", GetModeSizeInDIP(size, 2.0f, 0.5f, true)); |
110 } | 110 } |
111 | 111 |
112 TEST_F(DisplayInfoTest, DisplayModeGetSizeInDIP125) { | 112 TEST_F(DisplayInfoTest, DisplayModeGetSizeInDIP125) { |
113 DisplayInfo::SetUse125DSFForUIScaling(true); | |
114 gfx::Size size(1920, 1080); | 113 gfx::Size size(1920, 1080); |
115 EXPECT_EQ("2400x1350", GetModeSizeInDIP(size, 1.25f, 1.25f, true)); | 114 EXPECT_EQ("2400x1350", GetModeSizeInDIP(size, 1.25f, 1.25f, true)); |
116 EXPECT_EQ("1920x1080", GetModeSizeInDIP(size, 1.25f, 1.0f, true)); | 115 EXPECT_EQ("1920x1080", GetModeSizeInDIP(size, 1.25f, 1.0f, true)); |
117 EXPECT_EQ("1536x864", GetModeSizeInDIP(size, 1.25f, 0.8f, true)); | 116 EXPECT_EQ("1536x864", GetModeSizeInDIP(size, 1.25f, 0.8f, true)); |
118 EXPECT_EQ("1200x675", GetModeSizeInDIP(size, 1.25f, 0.625f, true)); | 117 EXPECT_EQ("1200x675", GetModeSizeInDIP(size, 1.25f, 0.625f, true)); |
119 EXPECT_EQ("960x540", GetModeSizeInDIP(size, 1.25f, 0.5f, true)); | 118 EXPECT_EQ("960x540", GetModeSizeInDIP(size, 1.25f, 0.5f, true)); |
120 DisplayInfo::SetUse125DSFForUIScaling(false); | |
121 } | 119 } |
122 | 120 |
123 TEST_F(DisplayInfoTest, DisplayModeGetSizeForExternal4K) { | 121 TEST_F(DisplayInfoTest, DisplayModeGetSizeForExternal4K) { |
124 DisplayInfo::SetUse125DSFForUIScaling(true); | |
125 gfx::Size size(3840, 2160); | 122 gfx::Size size(3840, 2160); |
126 EXPECT_EQ("1920x1080", GetModeSizeInDIP(size, 2.0f, 1.0f, false)); | 123 EXPECT_EQ("1920x1080", GetModeSizeInDIP(size, 2.0f, 1.0f, false)); |
127 EXPECT_EQ("3072x1728", GetModeSizeInDIP(size, 1.25f, 1.0f, false)); | 124 EXPECT_EQ("3072x1728", GetModeSizeInDIP(size, 1.25f, 1.0f, false)); |
128 EXPECT_EQ("3840x2160", GetModeSizeInDIP(size, 1.0f, 1.0f, false)); | 125 EXPECT_EQ("3840x2160", GetModeSizeInDIP(size, 1.0f, 1.0f, false)); |
129 DisplayInfo::SetUse125DSFForUIScaling(false); | |
130 } | 126 } |
131 | 127 |
132 } // namespace ash | 128 } // namespace ash |
OLD | NEW |