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

Unified Diff: content/common/common_param_traits_unittest.cc

Issue 2882303002: Factor FrameData out of RendererCompositorFrameSink (Closed)
Patch Set: c 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 | « content/common/BUILD.gn ('k') | content/common/content_param_traits_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/common_param_traits_unittest.cc
diff --git a/content/common/common_param_traits_unittest.cc b/content/common/common_param_traits_unittest.cc
index 8e5c3232a69bd6454dbe847fd5dbab79b8be8938..0e6dad68739198c52fc15b3e7e8f7e7775124e7b 100644
--- a/content/common/common_param_traits_unittest.cc
+++ b/content/common/common_param_traits_unittest.cc
@@ -255,3 +255,38 @@ TEST(IPCMessageTest, SSLInfo) {
ASSERT_EQ(in.ct_cert_policy_compliance, out.ct_cert_policy_compliance);
ASSERT_EQ(in.ocsp_result, out.ocsp_result);
}
+
+TEST(IPCMessageTest, RenderWidgetSurfaceProperties) {
+ content::RenderWidgetSurfaceProperties input;
+ input.size = gfx::Size(23, 45);
+ input.device_scale_factor = 0.8;
+#ifdef OS_ANDROID
+ input.top_controls_height = 16.5;
+ input.top_controls_shown_ratio = 0.4;
+ input.bottom_controls_height = 23.4;
+ input.bottom_controls_shown_ratio = 0.8;
+ input.selection.start.set_type(gfx::SelectionBound::Type::CENTER);
+ input.has_transparent_background = true;
+#endif
+
+ IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
+ IPC::ParamTraits<content::RenderWidgetSurfaceProperties>::Write(&msg, input);
+
+ content::RenderWidgetSurfaceProperties output;
+ base::PickleIterator iter(msg);
+ EXPECT_TRUE(IPC::ParamTraits<content::RenderWidgetSurfaceProperties>::Read(
+ &msg, &iter, &output));
+
+ EXPECT_EQ(input.size, output.size);
+ EXPECT_EQ(input.device_scale_factor, output.device_scale_factor);
+#ifdef OS_ANDROID
+ EXPECT_EQ(input.top_controls_height, output.top_controls_height);
+ EXPECT_EQ(input.top_controls_shown_ratio, output.top_controls_shown_ratio);
+ EXPECT_EQ(input.bottom_controls_height, output.bottom_controls_height);
+ EXPECT_EQ(input.bottom_controls_shown_ratio,
+ output.bottom_controls_shown_ratio);
+ EXPECT_EQ(input.selection, output.selection);
+ EXPECT_EQ(input.has_transparent_background,
+ output.has_transparent_background);
+#endif
+}
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/content_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698