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

Unified Diff: cc/surfaces/surface_aggregator_unittest.cc

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests Created 4 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: cc/surfaces/surface_aggregator_unittest.cc
diff --git a/cc/surfaces/surface_aggregator_unittest.cc b/cc/surfaces/surface_aggregator_unittest.cc
index b0ab189c474f73ba9231bb648bf3f257e52c993c..538f6de6fe710ebf9ac65ab944bf2051643905f0 100644
--- a/cc/surfaces/surface_aggregator_unittest.cc
+++ b/cc/surfaces/surface_aggregator_unittest.cc
@@ -38,8 +38,7 @@ namespace cc {
namespace {
SurfaceId InvalidSurfaceId() {
- static SurfaceId invalid;
- invalid.id = static_cast<uint64_t>(-1);
+ static SurfaceId invalid(0, 0, -1);
return invalid;
}
@@ -79,7 +78,7 @@ class SurfaceAggregatorTest : public testing::Test {
};
TEST_F(SurfaceAggregatorTest, ValidSurfaceNoFrame) {
- SurfaceId one_id(7);
+ SurfaceId one_id(0, 0, 7);
factory_.Create(one_id);
std::unique_ptr<CompositorFrame> frame = aggregator_.Aggregate(one_id);
@@ -1961,7 +1960,7 @@ void SubmitCompositorFrameWithResources(ResourceId* resource_ids,
TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) {
ResourceTrackingSurfaceFactoryClient client;
SurfaceFactory factory(&manager_, &client);
- SurfaceId surface_id(7u);
+ SurfaceId surface_id(0, 0, 7u);
factory.Create(surface_id);
ResourceId ids[] = {11, 12, 13};
@@ -1991,7 +1990,7 @@ TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) {
TEST_F(SurfaceAggregatorWithResourcesTest, TakeInvalidResources) {
ResourceTrackingSurfaceFactoryClient client;
SurfaceFactory factory(&manager_, &client);
- SurfaceId surface_id(7u);
+ SurfaceId surface_id(0, 0, 7u);
factory.Create(surface_id);
std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -2026,10 +2025,10 @@ TEST_F(SurfaceAggregatorWithResourcesTest, TakeInvalidResources) {
TEST_F(SurfaceAggregatorWithResourcesTest, TwoSurfaces) {
ResourceTrackingSurfaceFactoryClient client;
SurfaceFactory factory(&manager_, &client);
- SurfaceId surface1_id(7u);
+ SurfaceId surface1_id(0, 0, 7u);
factory.Create(surface1_id);
- SurfaceId surface2_id(8u);
+ SurfaceId surface2_id(0, 0, 8u);
factory.Create(surface2_id);
ResourceId ids[] = {11, 12, 13};
@@ -2067,11 +2066,11 @@ TEST_F(SurfaceAggregatorWithResourcesTest, TwoSurfaces) {
TEST_F(SurfaceAggregatorWithResourcesTest, InvalidChildSurface) {
ResourceTrackingSurfaceFactoryClient client;
SurfaceFactory factory(&manager_, &client);
- SurfaceId root_surface_id(7u);
+ SurfaceId root_surface_id(0, 0, 7u);
factory.Create(root_surface_id);
- SurfaceId middle_surface_id(8u);
+ SurfaceId middle_surface_id(0, 0, 8u);
factory.Create(middle_surface_id);
- SurfaceId child_surface_id(9u);
+ SurfaceId child_surface_id(0, 0, 9u);
factory.Create(child_surface_id);
ResourceId ids[] = {14, 15, 16};
@@ -2115,10 +2114,10 @@ TEST_F(SurfaceAggregatorWithResourcesTest, InvalidChildSurface) {
TEST_F(SurfaceAggregatorWithResourcesTest, SecureOutputTexture) {
ResourceTrackingSurfaceFactoryClient client;
SurfaceFactory factory(&manager_, &client);
- SurfaceId surface1_id(7u);
+ SurfaceId surface1_id(0, 0, 7u);
factory.Create(surface1_id);
- SurfaceId surface2_id(8u);
+ SurfaceId surface2_id(0, 0, 8u);
factory.Create(surface2_id);
ResourceId ids[] = {11, 12, 13};

Powered by Google App Engine
This is Rietveld 408576698