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

Unified Diff: cc/surfaces/surface_hittest_unittest.cc

Issue 2144733005: [WIP] cc: Plumb SurfaceId from clients Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure only SurfaceFactoy and tests can update hierarchy 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/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_id_allocator.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 6f0637f41a485048040e4338c47a78215daafe4d..b600e437fc6118d7a7c6ff596770e3864715ff01 100644
--- a/cc/surfaces/surface_hittest_unittest.cc
+++ b/cc/surfaces/surface_hittest_unittest.cc
@@ -20,6 +20,8 @@ namespace cc {
namespace {
+static constexpr uint32_t kArbitraryClientId = 1;
+
struct TestCase {
SurfaceId input_surface_id;
gfx::Point input_point;
@@ -61,7 +63,7 @@ using namespace test;
TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) {
SurfaceManager manager;
EmptySurfaceFactoryClient client;
- SurfaceFactory factory(&manager, &client);
+ SurfaceFactory factory(kArbitraryClientId, &manager, &client);
// Creates a root surface.
gfx::Rect root_rect(300, 300);
@@ -78,7 +80,7 @@ TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) {
child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(kArbitraryClientId);
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -99,7 +101,7 @@ TEST(SurfaceHittestTest, Hittest_BadCompositorFrameDoesNotCrash) {
TEST(SurfaceHittestTest, Hittest_SingleSurface) {
SurfaceManager manager;
EmptySurfaceFactoryClient client;
- SurfaceFactory factory(&manager, &client);
+ SurfaceFactory factory(kArbitraryClientId, &manager, &client);
// Creates a root surface.
gfx::Rect root_rect(300, 300);
@@ -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(kArbitraryClientId);
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -129,7 +131,7 @@ TEST(SurfaceHittestTest, Hittest_SingleSurface) {
TEST(SurfaceHittestTest, Hittest_ChildSurface) {
SurfaceManager manager;
EmptySurfaceFactoryClient client;
- SurfaceFactory factory(&manager, &client);
+ SurfaceFactory factory(kArbitraryClientId, &manager, &client);
// Creates a root surface.
gfx::Rect root_rect(300, 300);
@@ -150,7 +152,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) {
child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(kArbitraryClientId);
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -260,7 +262,7 @@ TEST(SurfaceHittestTest, Hittest_ChildSurface) {
TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) {
SurfaceManager manager;
EmptySurfaceFactoryClient client;
- SurfaceFactory factory(&manager, &client);
+ SurfaceFactory factory(kArbitraryClientId, &manager, &client);
// Creates a root surface.
gfx::Rect root_rect(300, 300);
@@ -288,7 +290,7 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) {
child_surface_id);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(2);
+ SurfaceIdAllocator root_allocator(kArbitraryClientId);
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -361,7 +363,7 @@ TEST(SurfaceHittestTest, Hittest_InvalidRenderPassDrawQuad) {
TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) {
SurfaceManager manager;
EmptySurfaceFactoryClient client;
- SurfaceFactory factory(&manager, &client);
+ SurfaceFactory factory(kArbitraryClientId, &manager, &client);
// Create a CompostiorFrame with two RenderPasses.
gfx::Rect root_rect(300, 300);
@@ -406,7 +408,7 @@ TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) {
child_solid_quad_rect);
// Submit the root frame.
- SurfaceIdAllocator root_allocator(1);
+ SurfaceIdAllocator root_allocator(kArbitraryClientId);
SurfaceId root_surface_id = root_allocator.GenerateId();
factory.Create(root_surface_id);
factory.SubmitCompositorFrame(root_surface_id, std::move(root_frame),
@@ -464,7 +466,7 @@ TEST(SurfaceHittestTest, Hittest_RenderPassDrawQuad) {
TEST(SurfaceHittestTest, Hittest_SingleSurface_WithInsetsDelegate) {
SurfaceManager manager;
EmptySurfaceFactoryClient client;
- SurfaceFactory factory(&manager, &client);
+ SurfaceFactory factory(kArbitraryClientId, &manager, &client);
// Creates a root surface.
gfx::Rect root_rect(300, 300);
« no previous file with comments | « cc/surfaces/surface_factory_unittest.cc ('k') | cc/surfaces/surface_id_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698