Add a struct for spellcheck marker
[chromium-blink-merge.git] / ash / display / display_info_unittest.cc
blob680691585545af8bc5af79998b10b35b7d5a0c27
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.
5 #include "ash/display/display_info.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 namespace ash {
10 namespace internal {
12 typedef testing::Test DisplayInfoTest;
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(gfx::Display::ROTATE_0, info.rotation());
20 EXPECT_EQ("0,0,0,0", info.overscan_insets_in_dip().ToString());
21 EXPECT_EQ(1.0f, info.ui_scale());
23 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/o", 10);
24 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
25 EXPECT_EQ("286x380", info.size_in_pixel().ToString());
26 EXPECT_EQ(gfx::Display::ROTATE_0, info.rotation());
27 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
29 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/ob", 10);
30 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
31 EXPECT_EQ("286x380", info.size_in_pixel().ToString());
32 EXPECT_EQ(gfx::Display::ROTATE_0, info.rotation());
33 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
35 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/or", 10);
36 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
37 EXPECT_EQ("380x286", info.size_in_pixel().ToString());
38 EXPECT_EQ(gfx::Display::ROTATE_90, info.rotation());
39 // TODO(oshima): This should be rotated too. Fix this.
40 EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
42 info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/l@1.5", 10);
43 EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
44 EXPECT_EQ(gfx::Display::ROTATE_270, info.rotation());
45 EXPECT_EQ(1.5f, info.ui_scale());
48 } // namespace internal
49 } // namespace ash