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

Unified 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: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/display/display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_info_unittest.cc
diff --git a/ash/display/display_info_unittest.cc b/ash/display/display_info_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..76341b0f595d09ad754ced276d79aea3a80c88ba
--- /dev/null
+++ b/ash/display/display_info_unittest.cc
@@ -0,0 +1,43 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/display/display_info.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace ash {
+namespace internal {
+
+typedef testing::Test DisplayInfoTest;
+
+TEST_F(DisplayInfoTest, CreateFromSpec) {
+ DisplayInfo info = DisplayInfo::CreateFromSpecWithID("200x100", 10);
+ EXPECT_EQ(10, info.id());
+ EXPECT_EQ("0,0 200x100", info.bounds_in_pixel().ToString());
+ EXPECT_EQ("200x100", info.size_in_pixel().ToString());
+ EXPECT_EQ(DisplayInfo::ROTATE_0, info.rotation());
+ EXPECT_EQ("0,0,0,0", info.overscan_insets_in_dip().ToString());
+
+ info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/o", 10);
+ EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
+ EXPECT_EQ("286x380", info.size_in_pixel().ToString());
+ EXPECT_EQ(DisplayInfo::ROTATE_0, info.rotation());
+ EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
+
+ info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/ob", 10);
+ EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
+ EXPECT_EQ("286x380", info.size_in_pixel().ToString());
+ EXPECT_EQ(DisplayInfo::ROTATE_0, info.rotation());
+ EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
+
+ info = DisplayInfo::CreateFromSpecWithID("10+20-300x400*2/or", 10);
+ EXPECT_EQ("10,20 300x400", info.bounds_in_pixel().ToString());
+ EXPECT_EQ("380x286", info.size_in_pixel().ToString());
+ EXPECT_EQ(DisplayInfo::ROTATE_90, info.rotation());
+ // TODO(oshima): This should be rotated too. Fix this.
+ EXPECT_EQ("5,3,5,3", info.overscan_insets_in_dip().ToString());
+}
+
+} // namespace internal
+} // namespace ash
« 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