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

Unified Diff: ui/ozone/platform/drm/common/drm_util_unittest.cc

Issue 2894523007: Use display::DisplayMode in ozone/drm/gpu (Closed)
Patch Set: review nits Created 3 years, 7 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 | « ui/ozone/platform/drm/common/drm_util.cc ('k') | ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/common/drm_util_unittest.cc
diff --git a/ui/ozone/platform/drm/common/drm_util_unittest.cc b/ui/ozone/platform/drm/common/drm_util_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1739d3e1e5becbc67c58853d93de334f56209678
--- /dev/null
+++ b/ui/ozone/platform/drm/common/drm_util_unittest.cc
@@ -0,0 +1,30 @@
+// Copyright 2017 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 "ui/ozone/platform/drm/common/drm_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
+
+namespace ui {
+
+class DrmUtilTest : public testing::Test {};
+
+TEST_F(DrmUtilTest, RoundTripEquivalence) {
+ DisplayMode_Params orig_params;
+
+ orig_params.size = gfx::Size(101, 42);
+ orig_params.is_interlaced = true;
+ orig_params.refresh_rate = 3.14;
+
+ auto udm = CreateDisplayModeFromParams(orig_params);
+ auto roundtrip_params = GetDisplayModeParams(*udm.get());
+
+ EXPECT_EQ(orig_params.size.width(), roundtrip_params.size.width());
+ EXPECT_EQ(orig_params.size.height(), roundtrip_params.size.height());
+ EXPECT_EQ(orig_params.is_interlaced, roundtrip_params.is_interlaced);
+ EXPECT_EQ(orig_params.refresh_rate, roundtrip_params.refresh_rate);
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/common/drm_util.cc ('k') | ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698