Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: ash/display/display_change_observer_chromeos_unittest.cc

Issue 27156003: linux_aura: Enable HIDPI support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made GetDeviceScaleFactor clearer. Put unittest to 'all_sources' in .gyp Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "ash/display/display_change_observer_chromeos.h" 5 #include "ash/display/display_change_observer_chromeos.h"
6 6
7 #include "ash/display/display_info.h" 7 #include "ash/display/display_info.h"
8 #include "chromeos/display/output_configurator.h" 8 #include "chromeos/display/output_configurator.h"
9 #include "chromeos/display/output_util.h" 9 #include "chromeos/display/output_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using chromeos::OutputConfigurator; 12 using chromeos::OutputConfigurator;
13 13
14 typedef testing::Test DisplayChangeObserverTest; 14 typedef testing::Test DisplayChangeObserverTest;
15 15
16 namespace ash { 16 namespace ash {
17 namespace internal { 17 namespace internal {
18 18
19 TEST_F(DisplayChangeObserverTest, TestBlackListedDisplay) {
20 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(10, 10));
21 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(40, 30));
22 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(50, 40));
23 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(160, 90));
24 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(160, 100));
25
26 EXPECT_FALSE(DisplayChangeObserver::ShouldIgnoreSize(50, 60));
27 EXPECT_FALSE(DisplayChangeObserver::ShouldIgnoreSize(100, 70));
28 EXPECT_FALSE(DisplayChangeObserver::ShouldIgnoreSize(272, 181));
29 }
30
31 TEST_F(DisplayChangeObserverTest, GetResolutionList) { 19 TEST_F(DisplayChangeObserverTest, GetResolutionList) {
32 OutputConfigurator::OutputSnapshot output; 20 OutputConfigurator::OutputSnapshot output;
33 output.mode_infos[11] = OutputConfigurator::ModeInfo(1920, 1200, false, 60); 21 output.mode_infos[11] = OutputConfigurator::ModeInfo(1920, 1200, false, 60);
34 22
35 // All non-interlaced (as would be seen with different refresh rates). 23 // All non-interlaced (as would be seen with different refresh rates).
36 output.mode_infos[12] = OutputConfigurator::ModeInfo(1920, 1080, false, 80); 24 output.mode_infos[12] = OutputConfigurator::ModeInfo(1920, 1080, false, 80);
37 output.mode_infos[13] = OutputConfigurator::ModeInfo(1920, 1080, false, 70); 25 output.mode_infos[13] = OutputConfigurator::ModeInfo(1920, 1080, false, 70);
38 output.mode_infos[14] = OutputConfigurator::ModeInfo(1920, 1080, false, 60); 26 output.mode_infos[14] = OutputConfigurator::ModeInfo(1920, 1080, false, 60);
39 27
40 // Interlaced vs non-interlaced. 28 // Interlaced vs non-interlaced.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 EXPECT_TRUE(resolutions[5].interlaced); 63 EXPECT_TRUE(resolutions[5].interlaced);
76 64
77 // Outputs without any modes shouldn't cause a crash. 65 // Outputs without any modes shouldn't cause a crash.
78 output.mode_infos.clear(); 66 output.mode_infos.clear();
79 resolutions = DisplayChangeObserver::GetResolutionList(output); 67 resolutions = DisplayChangeObserver::GetResolutionList(output);
80 EXPECT_EQ(0u, resolutions.size()); 68 EXPECT_EQ(0u, resolutions.size());
81 } 69 }
82 70
83 } // namespace internal 71 } // namespace internal
84 } // namespace ash 72 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698