OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/display/manager/chromeos/display_change_observer.h" | 5 #include "ui/display/manager/chromeos/display_change_observer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 // 12.1" 1280x800 | 330 // 12.1" 1280x800 |
331 EXPECT_EQ(1.0f, ComputeDeviceScaleFactor(12.1f, gfx::Rect(1280, 800))); | 331 EXPECT_EQ(1.0f, ComputeDeviceScaleFactor(12.1f, gfx::Rect(1280, 800))); |
332 | 332 |
333 // 13.3" 1920x1080 | 333 // 13.3" 1920x1080 |
334 EXPECT_EQ(1.25f, ComputeDeviceScaleFactor(13.3f, gfx::Rect(1920, 1080))); | 334 EXPECT_EQ(1.25f, ComputeDeviceScaleFactor(13.3f, gfx::Rect(1920, 1080))); |
335 | 335 |
336 // 14" 1920x1080 | 336 // 14" 1920x1080 |
337 EXPECT_EQ(1.25f, ComputeDeviceScaleFactor(14.0f, gfx::Rect(1920, 1080))); | 337 EXPECT_EQ(1.25f, ComputeDeviceScaleFactor(14.0f, gfx::Rect(1920, 1080))); |
338 | 338 |
339 // 11.6" 1920x1080 | 339 // 11.6" 1920x1080 |
340 EXPECT_EQ(1.5f, ComputeDeviceScaleFactor(11.6f, gfx::Rect(1920, 1080))); | 340 EXPECT_EQ(1.25f, ComputeDeviceScaleFactor(11.6f, gfx::Rect(1920, 1080))); |
| 341 |
| 342 // 12.02" 2160x1440 |
| 343 EXPECT_EQ(1.6f, ComputeDeviceScaleFactor(12.02f, gfx::Rect(2160, 1440))); |
341 | 344 |
342 // 12.85" 2560x1700 | 345 // 12.85" 2560x1700 |
343 EXPECT_EQ(2.0f, ComputeDeviceScaleFactor(12.85f, gfx::Rect(2560, 1700))); | 346 EXPECT_EQ(2.0f, ComputeDeviceScaleFactor(12.85f, gfx::Rect(2560, 1700))); |
344 | 347 |
345 // 12.3" 2400x1600 | 348 // 12.3" 2400x1600 |
346 EXPECT_EQ(2.0f, ComputeDeviceScaleFactor(12.3f, gfx::Rect(2400, 1600))); | 349 EXPECT_EQ(2.0f, ComputeDeviceScaleFactor(12.3f, gfx::Rect(2400, 1600))); |
347 | 350 |
348 // Erroneous values should still work. | 351 // Erroneous values should still work. |
349 EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(-100.0f)); | 352 EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(-100.0f)); |
350 EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(0.0f)); | 353 EXPECT_EQ(1.0f, DisplayChangeObserver::FindDeviceScaleFactor(0.0f)); |
(...skipping 17 matching lines...) Expand all Loading... |
368 EXPECT_FALSE(display_modes[0]->native()); | 371 EXPECT_FALSE(display_modes[0]->native()); |
369 EXPECT_EQ(display_modes[0]->refresh_rate(), 60); | 372 EXPECT_EQ(display_modes[0]->refresh_rate(), 60); |
370 | 373 |
371 EXPECT_EQ("1920x1080", display_modes[1]->size().ToString()); | 374 EXPECT_EQ("1920x1080", display_modes[1]->size().ToString()); |
372 EXPECT_TRUE(display_modes[1]->is_interlaced()); | 375 EXPECT_TRUE(display_modes[1]->is_interlaced()); |
373 EXPECT_TRUE(display_modes[1]->native()); | 376 EXPECT_TRUE(display_modes[1]->native()); |
374 EXPECT_EQ(display_modes[1]->refresh_rate(), 60); | 377 EXPECT_EQ(display_modes[1]->refresh_rate(), 60); |
375 } | 378 } |
376 | 379 |
377 } // namespace display | 380 } // namespace display |
OLD | NEW |