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

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: Updated accordigly to r232633 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
« no previous file with comments | « ash/display/display_change_observer_chromeos.cc ('k') | ui/base/x/x11_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using chromeos::OutputConfigurator; 11 using chromeos::OutputConfigurator;
12 12
13 typedef testing::Test DisplayChangeObserverTest; 13 typedef testing::Test DisplayChangeObserverTest;
14 14
15 namespace ash { 15 namespace ash {
16 namespace internal { 16 namespace internal {
17 17
18 TEST_F(DisplayChangeObserverTest, TestBlackListedDisplay) {
19 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(10, 10));
20 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(40, 30));
21 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(50, 40));
22 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(160, 90));
23 EXPECT_TRUE(DisplayChangeObserver::ShouldIgnoreSize(160, 100));
24
25 EXPECT_FALSE(DisplayChangeObserver::ShouldIgnoreSize(50, 60));
26 EXPECT_FALSE(DisplayChangeObserver::ShouldIgnoreSize(100, 70));
27 EXPECT_FALSE(DisplayChangeObserver::ShouldIgnoreSize(272, 181));
28 }
29
30 TEST_F(DisplayChangeObserverTest, GetResolutionList) { 18 TEST_F(DisplayChangeObserverTest, GetResolutionList) {
31 OutputConfigurator::OutputSnapshot output; 19 OutputConfigurator::OutputSnapshot output;
32 output.mode_infos[11] = OutputConfigurator::ModeInfo(1920, 1200, false, 60); 20 output.mode_infos[11] = OutputConfigurator::ModeInfo(1920, 1200, false, 60);
33 21
34 // All non-interlaced (as would be seen with different refresh rates). 22 // All non-interlaced (as would be seen with different refresh rates).
35 output.mode_infos[12] = OutputConfigurator::ModeInfo(1920, 1080, false, 80); 23 output.mode_infos[12] = OutputConfigurator::ModeInfo(1920, 1080, false, 80);
36 output.mode_infos[13] = OutputConfigurator::ModeInfo(1920, 1080, false, 70); 24 output.mode_infos[13] = OutputConfigurator::ModeInfo(1920, 1080, false, 70);
37 output.mode_infos[14] = OutputConfigurator::ModeInfo(1920, 1080, false, 60); 25 output.mode_infos[14] = OutputConfigurator::ModeInfo(1920, 1080, false, 60);
38 26
39 // Interlaced vs non-interlaced. 27 // Interlaced vs non-interlaced.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 EXPECT_TRUE(resolutions[5].interlaced); 62 EXPECT_TRUE(resolutions[5].interlaced);
75 63
76 // Outputs without any modes shouldn't cause a crash. 64 // Outputs without any modes shouldn't cause a crash.
77 output.mode_infos.clear(); 65 output.mode_infos.clear();
78 resolutions = DisplayChangeObserver::GetResolutionList(output); 66 resolutions = DisplayChangeObserver::GetResolutionList(output);
79 EXPECT_EQ(0u, resolutions.size()); 67 EXPECT_EQ(0u, resolutions.size());
80 } 68 }
81 69
82 } // namespace internal 70 } // namespace internal
83 } // namespace ash 71 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_change_observer_chromeos.cc ('k') | ui/base/x/x11_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698