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

Unified Diff: cc/ipc/struct_traits_unittest.cc

Issue 2170603002: cc: Fix negative integer overflow in RenderPass serialization code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test. Created 4 years, 5 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 | « cc/ipc/render_pass_struct_traits.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ipc/struct_traits_unittest.cc
diff --git a/cc/ipc/struct_traits_unittest.cc b/cc/ipc/struct_traits_unittest.cc
index 2748f6f191d2b3c4de0a85e037c0c36cff0faf4e..7f49066890113247456814e00af77f54399eca57 100644
--- a/cc/ipc/struct_traits_unittest.cc
+++ b/cc/ipc/struct_traits_unittest.cc
@@ -666,6 +666,33 @@ TEST_F(StructTraitsTest, RenderPass) {
EXPECT_EQ(surface_quad->surface_id, out_surface_quad->surface_id);
}
+TEST_F(StructTraitsTest, RenderPassWithEmptySharedQuadStateList) {
+ const RenderPassId id(3, 2);
+ const gfx::Rect output_rect(45, 22, 120, 13);
+ const gfx::Transform transform_to_root =
+ gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
+ const gfx::Rect damage_rect(56, 123, 19, 43);
+ const bool has_transparent_background = true;
+ std::unique_ptr<RenderPass> input = RenderPass::Create();
+ input->SetAll(id, output_rect, damage_rect, transform_to_root,
+ has_transparent_background);
+
+ // Unlike the previous test, don't add any quads to the list; we need to
+ // verify that the serialization code can deal with that.
+ std::unique_ptr<RenderPass> output;
+ mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
+ proxy->EchoRenderPass(input, &output);
+
+ EXPECT_EQ(input->quad_list.size(), output->quad_list.size());
+ EXPECT_EQ(input->shared_quad_state_list.size(),
+ output->shared_quad_state_list.size());
+ EXPECT_EQ(id, output->id);
+ EXPECT_EQ(output_rect, output->output_rect);
+ EXPECT_EQ(damage_rect, output->damage_rect);
+ EXPECT_EQ(transform_to_root, output->transform_to_root_target);
+ EXPECT_EQ(has_transparent_background, output->has_transparent_background);
+}
+
TEST_F(StructTraitsTest, RenderPassId) {
const int layer_id = 1337;
const uint32_t index = 0xdeadbeef;
« no previous file with comments | « cc/ipc/render_pass_struct_traits.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698