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

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

Issue 455443002: Remember the configured device scale factor for external displays. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 4 months 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_info.cc ('k') | ash/display/display_manager.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 (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 10
(...skipping 26 matching lines...) Expand all
37 EXPECT_EQ(gfx::Display::ROTATE_90, info.rotation()); 37 EXPECT_EQ(gfx::Display::ROTATE_90, info.rotation());
38 // TODO(oshima): This should be rotated too. Fix this. 38 // TODO(oshima): This should be rotated too. Fix this.
39 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString()); 39 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
40 40
41 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/l@1.5", 10); 41 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/l@1.5", 10);
42 EXPECT_EQ("10,20 300x400", info.bounds_in_native().ToString()); 42 EXPECT_EQ("10,20 300x400", info.bounds_in_native().ToString());
43 EXPECT_EQ(gfx::Display::ROTATE_270, info.rotation()); 43 EXPECT_EQ(gfx::Display::ROTATE_270, info.rotation());
44 EXPECT_EQ(1.5f, info.configured_ui_scale()); 44 EXPECT_EQ(1.5f, info.configured_ui_scale());
45 45
46 info = DisplayInfo::CreateFromSpecWithID( 46 info = DisplayInfo::CreateFromSpecWithID(
47 "200x200#300x200|200x200%59.9|100x100%60", 10); 47 "200x200#300x200|200x200%59.9|100x100%60|150x100*2|150x150*1.25%30", 10);
48 EXPECT_EQ("0,0 200x200", info.bounds_in_native().ToString()); 48 EXPECT_EQ("0,0 200x200", info.bounds_in_native().ToString());
49 EXPECT_EQ(3u, info.display_modes().size()); 49 EXPECT_EQ(5u, info.display_modes().size());
50 EXPECT_EQ("300x200", info.display_modes()[0].size.ToString()); 50 EXPECT_EQ("300x200", info.display_modes()[0].size.ToString());
51 EXPECT_EQ("200x200", info.display_modes()[1].size.ToString()); 51 EXPECT_EQ("200x200", info.display_modes()[1].size.ToString());
52 EXPECT_EQ("100x100", info.display_modes()[2].size.ToString()); 52 EXPECT_EQ("100x100", info.display_modes()[2].size.ToString());
53 EXPECT_EQ("150x100", info.display_modes()[3].size.ToString());
54 EXPECT_EQ("150x150", info.display_modes()[4].size.ToString());
53 EXPECT_EQ(59.9f, info.display_modes()[1].refresh_rate); 55 EXPECT_EQ(59.9f, info.display_modes()[1].refresh_rate);
54 EXPECT_EQ(60.0f, info.display_modes()[2].refresh_rate); 56 EXPECT_EQ(60.0f, info.display_modes()[2].refresh_rate);
57 EXPECT_EQ(30.0f, info.display_modes()[4].refresh_rate);
58 EXPECT_EQ(1.0f, info.display_modes()[0].device_scale_factor);
59 EXPECT_EQ(1.0f, info.display_modes()[1].device_scale_factor);
60 EXPECT_EQ(1.0f, info.display_modes()[2].device_scale_factor);
61 EXPECT_EQ(2.0f, info.display_modes()[3].device_scale_factor);
62 EXPECT_EQ(1.25f, info.display_modes()[4].device_scale_factor);
55 EXPECT_TRUE(info.display_modes()[0].native); 63 EXPECT_TRUE(info.display_modes()[0].native);
56 EXPECT_FALSE(info.display_modes()[1].native); 64 EXPECT_FALSE(info.display_modes()[1].native);
57 EXPECT_FALSE(info.display_modes()[2].native); 65 EXPECT_FALSE(info.display_modes()[2].native);
66 EXPECT_FALSE(info.display_modes()[3].native);
67 EXPECT_FALSE(info.display_modes()[4].native);
58 } 68 }
59 69
60 } // namespace ash 70 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/display/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698