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

Unified Diff: cc/surfaces/surface_hittest_unittest.cc

Issue 2382873002: Replace usage of SurfaceId's client_id with FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 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/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_hittest_unittest.cc
diff --git a/cc/surfaces/surface_hittest_unittest.cc b/cc/surfaces/surface_hittest_unittest.cc
index a144960a135336a5d22d2f5685fbe52e7078ee22..b4744c99fc5f395490c7f1531eddf0b6a5ca4761 100644
--- a/cc/surfaces/surface_hittest_unittest.cc
+++ b/cc/surfaces/surface_hittest_unittest.cc
@@ -20,6 +20,8 @@ namespace cc {
namespace {
+static constexpr FrameSinkId kArbitraryFrameSinkId(1, 1);
+
struct TestCase {
SurfaceId input_surface_id;
gfx::Point input_point;
@@ -69,7 +71,7 @@ TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) {
CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass);
// Add a reference to a non-existant child surface on the root surface.
- SurfaceId child_surface_id(3, 0xdeadbeef, 0);
+ SurfaceId child_surface_id(kArbitraryFrameSinkId, 0xdeadbeef, 0);
gfx::Rect child_rect(200, 200);
CreateSurfaceDrawQuad(root_pass,
gfx::Transform(),
@@ -78,7 +80,7 @@ TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) {
child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(FrameSinkId(2, 2));
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -107,7 +109,7 @@ TEST(SurfaceHittestTest, Hittest_SingleSurface) {
CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(FrameSinkId(2, 2));
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -137,7 +139,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) {
CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass);
// Add a reference to the child surface on the root surface.
- SurfaceIdAllocator child_allocator(3);
+ SurfaceIdAllocator child_allocator(FrameSinkId(3, 3));
SurfaceId child_surface_id = child_allocator.GenerateId();
gfx::Rect child_rect(200, 200);
CreateSurfaceDrawQuad(root_pass,
@@ -150,7 +152,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) {
child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(FrameSinkId(2, 2));
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -275,7 +277,7 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) {
RenderPassId(1337, 1337));
// Add a reference to the child surface on the root surface.
- SurfaceIdAllocator child_allocator(3);
+ SurfaceIdAllocator child_allocator(FrameSinkId(3, 3));
SurfaceId child_surface_id = child_allocator.GenerateId();
gfx::Rect child_rect(200, 200);
CreateSurfaceDrawQuad(root_pass,
@@ -288,7 +290,7 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) {
child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(FrameSinkId(2, 2));
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -406,7 +408,7 @@ TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) {
child_solid_quad_rect);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(1);
+ SurfaceIdAllocator root_allocator(FrameSinkId(1, 1));
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -472,7 +474,7 @@ TEST(SurfaceHittestTest, Hittest_SingleSurface_WithInsetsDelegate) {
CompositorFrame root_frame = CreateCompositorFrame(root_rect, &root_pass);
// Add a reference to the child surface on the root surface.
- SurfaceIdAllocator child_allocator(3);
+ SurfaceIdAllocator child_allocator(FrameSinkId(3, 3));
SurfaceId child_surface_id = child_allocator.GenerateId();
gfx::Rect child_rect(200, 200);
CreateSurfaceDrawQuad(
@@ -484,7 +486,7 @@ TEST(SurfaceHittestTest, Hittest_SingleSurface_WithInsetsDelegate) {
root_rect, child_rect, child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(FrameSinkId(2, 2));
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698