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

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

Issue 12746002: Re-implement overscan & Implement Display Rotation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/display/display_info.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace ash {
10 namespace internal {
11
12 typedef testing::Test DisplayInfoTest;
13
14 TEST_F(DisplayInfoTest, CreateFromSpec) {
15 DisplayInfo info = DisplayInfo::CreateFromSpecWithID("200x100", 10);
16 EXPECT_EQ(10, info.id());
17 EXPECT_EQ("0,0 200x100", info.bounds_in_pixel().ToString());
18 EXPECT_EQ("200x100", info.size_in_pixel().ToString());
19 EXPECT_EQ(DisplayInfo::Rotate0, info.rotation());
20 EXPECT_EQ("0,0,0,0", info.overscan_insets_in_dip().ToString());
21
22 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/o", 10);
23 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
24 EXPECT_EQ("286x380", info.size_in_pixel().ToString());
25 EXPECT_EQ(DisplayInfo::Rotate0, info.rotation());
26 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
27
28 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/ob", 10);
29 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
30 EXPECT_EQ("286x380", info.size_in_pixel().ToString());
31 EXPECT_EQ(DisplayInfo::Rotate0, info.rotation());
32 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
33
34 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/or", 10);
35 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
36 EXPECT_EQ("380x286", info.size_in_pixel().ToString());
37 EXPECT_EQ(DisplayInfo::Rotate90, info.rotation());
38 // TODO(oshima): This should be rotated too. Fix this.
39 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
40 }
41
42 } // namespace internal
43 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698