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

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

Issue 2894523007: Use display::DisplayMode in ozone/drm/gpu (Closed)
Patch Set: 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
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"
dnicoara 2017/05/23 18:48:20 Out of order include.
rjkroege 2017/05/23 22:08:18 Weird that presubmit didn't catch. Fixed.
+#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

Powered by Google App Engine
This is Rietveld 408576698