| OLD | NEW |
| 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/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 EXPECT_EQ(96, result[0]->dpi_x); | 295 EXPECT_EQ(96, result[0]->dpi_x); |
| 296 EXPECT_EQ(96, result[0]->dpi_y); | 296 EXPECT_EQ(96, result[0]->dpi_y); |
| 297 | 297 |
| 298 EXPECT_EQ("500,0 200x260", | 298 EXPECT_EQ("500,0 200x260", |
| 299 SystemInfoDisplayBoundsToString(result[1]->bounds)); | 299 SystemInfoDisplayBoundsToString(result[1]->bounds)); |
| 300 // DPI should be 96 (native dpi) * 200 (display) / 400 (native) when ui scale | 300 // DPI should be 96 (native dpi) * 200 (display) / 400 (native) when ui scale |
| 301 // is 2. | 301 // is 2. |
| 302 EXPECT_EQ(96 / 2, result[1]->dpi_x); | 302 EXPECT_EQ(96 / 2, result[1]->dpi_x); |
| 303 EXPECT_EQ(96 / 2, result[1]->dpi_y); | 303 EXPECT_EQ(96 / 2, result[1]->dpi_y); |
| 304 | 304 |
| 305 GetWindowTreeHostManager()->SwapPrimaryDisplay(); | 305 GetWindowTreeHostManager()->SwapPrimaryDisplayForTest(); |
| 306 | 306 |
| 307 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); | 307 result = DisplayInfoProvider::Get()->GetAllDisplaysInfo(); |
| 308 | 308 |
| 309 ASSERT_EQ(2u, result.size()); | 309 ASSERT_EQ(2u, result.size()); |
| 310 | 310 |
| 311 EXPECT_EQ("-500,0 500x600", | 311 EXPECT_EQ("-500,0 500x600", |
| 312 SystemInfoDisplayBoundsToString(result[0]->bounds)); | 312 SystemInfoDisplayBoundsToString(result[0]->bounds)); |
| 313 EXPECT_EQ(96, result[0]->dpi_x); | 313 EXPECT_EQ(96, result[0]->dpi_x); |
| 314 EXPECT_EQ(96, result[0]->dpi_y); | 314 EXPECT_EQ(96, result[0]->dpi_y); |
| 315 | 315 |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 std::string error; | 1079 std::string error; |
| 1080 CallSetDisplayUnitInfo( | 1080 CallSetDisplayUnitInfo( |
| 1081 base::Int64ToString(internal_display_id), info, &success, &error); | 1081 base::Int64ToString(internal_display_id), info, &success, &error); |
| 1082 | 1082 |
| 1083 ASSERT_FALSE(success); | 1083 ASSERT_FALSE(success); |
| 1084 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error); | 1084 EXPECT_EQ("Overscan changes not allowed for the internal monitor.", error); |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 } // namespace | 1087 } // namespace |
| 1088 } // namespace extensions | 1088 } // namespace extensions |
| OLD | NEW |