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

Unified Diff: cc/layers/surface_layer_unittest.cc

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ben's comment 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
« no previous file with comments | « cc/layers/surface_layer_impl_unittest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer_unittest.cc
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
index b7db7abd6414c36cdcacdd522b9e5b1ba7e83934..83ba4a0a6ffe886a4929266fa9f37f69599bb98c 100644
--- a/cc/layers/surface_layer_unittest.cc
+++ b/cc/layers/surface_layer_unittest.cc
@@ -73,7 +73,7 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
scoped_refptr<SurfaceLayer> layer(SurfaceLayer::Create(
base::Bind(&SatisfyCallback, &blank_change),
base::Bind(&RequireCallback, &required_id, &required_seq)));
- layer->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
+ layer->SetSurfaceId(SurfaceId(0, 1, 0), 1.f, gfx::Size(1, 1));
layer_tree_host_->set_surface_id_namespace(1);
layer_tree_host_->SetRootLayer(layer);
@@ -82,7 +82,7 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
scoped_refptr<SurfaceLayer> layer2(SurfaceLayer::Create(
base::Bind(&SatisfyCallback, &blank_change),
base::Bind(&RequireCallback, &required_id, &required_seq)));
- layer2->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
+ layer2->SetSurfaceId(SurfaceId(0, 1, 0), 1.f, gfx::Size(1, 1));
layer_tree_host2->set_surface_id_namespace(2);
layer_tree_host2->SetRootLayer(layer2);
@@ -101,7 +101,7 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
// Set of sequences that need to be satisfied should include sequences from
// both trees.
- EXPECT_TRUE(required_id == SurfaceId(1));
+ EXPECT_TRUE(required_id == SurfaceId(0, 1, 0));
EXPECT_EQ(2u, required_seq.size());
EXPECT_TRUE(required_seq.count(expected1));
EXPECT_TRUE(required_seq.count(expected2));
@@ -129,7 +129,7 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
layer_ = SurfaceLayer::Create(
base::Bind(&SatisfyCallback, &satisfied_sequence_),
base::Bind(&RequireCallback, &required_id_, &required_set_));
- layer_->SetSurfaceId(SurfaceId(1), 1.f, gfx::Size(1, 1));
+ layer_->SetSurfaceId(SurfaceId(0, 1, 0), 1.f, gfx::Size(1, 1));
// Layer hasn't been added to tree so no SurfaceSequence generated yet.
EXPECT_EQ(0u, required_set_.size());
@@ -138,7 +138,7 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
// Should have SurfaceSequence from first tree.
SurfaceSequence expected(1u, 1u);
- EXPECT_TRUE(required_id_ == SurfaceId(1));
+ EXPECT_TRUE(required_id_ == SurfaceId(0, 1, 0));
EXPECT_EQ(1u, required_set_.size());
EXPECT_TRUE(required_set_.count(expected));
@@ -208,7 +208,7 @@ class SurfaceLayerSwapPromiseWithDraw : public SurfaceLayerSwapPromise {
}
void AfterTest() override {
- EXPECT_TRUE(required_id_ == SurfaceId(1));
+ EXPECT_TRUE(required_id_ == SurfaceId(0, 1, 0));
EXPECT_EQ(1u, required_set_.size());
// Sequence should have been satisfied through Swap, not with the
// callback.
@@ -249,7 +249,7 @@ class SurfaceLayerSwapPromiseWithoutDraw : public SurfaceLayerSwapPromise {
}
void AfterTest() override {
- EXPECT_TRUE(required_id_ == SurfaceId(1));
+ EXPECT_TRUE(required_id_ == SurfaceId(0, 1, 0));
EXPECT_EQ(1u, required_set_.size());
// Sequence should have been satisfied with the callback.
EXPECT_TRUE(satisfied_sequence_ == SurfaceSequence(1u, 1u));
« no previous file with comments | « cc/layers/surface_layer_impl_unittest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698