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

Unified Diff: content/common/common_param_traits_unittest.cc

Issue 2882303002: Factor FrameData out of RendererCompositorFrameSink (Closed)
Patch Set: Remove duplicate line in build file 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: 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..7f1cefd9a46124b18fa9c35b651ede17d82ed70f 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.frame_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 = selection;
+ 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.frame_size, output.frame_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
+}

Powered by Google App Engine
This is Rietveld 408576698