| Index: cc/layers/surface_layer_unittest.cc
|
| diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc
|
| index 1cbb41003bffd79a9fad3a7a31a2055e5b9980df..5b688676e02ccd34764232b9f6f1f5e0bc052fec 100644
|
| --- a/cc/layers/surface_layer_unittest.cc
|
| +++ b/cc/layers/surface_layer_unittest.cc
|
| @@ -69,6 +69,8 @@ void RequireCallback(SurfaceId* out_id,
|
| // Check that one surface can be referenced by multiple LayerTreeHosts, and
|
| // each will create its own SurfaceSequence that's satisfied on destruction.
|
| TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
|
| + const base::UnguessableToken kArbitraryToken =
|
| + base::UnguessableToken::Create();
|
| SurfaceSequence blank_change; // Receives sequence if commit doesn't happen.
|
|
|
| SurfaceId required_id;
|
| @@ -76,8 +78,9 @@ 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(kArbitraryFrameSinkId, LocalFrameId(1, 0)), 1.f,
|
| - gfx::Size(1, 1));
|
| + layer->SetSurfaceId(
|
| + SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, kArbitraryToken)), 1.f,
|
| + gfx::Size(1, 1));
|
| layer_tree_host_->GetSurfaceSequenceGenerator()->set_frame_sink_id(
|
| FrameSinkId(1, 1));
|
| layer_tree_->SetRootLayer(layer);
|
| @@ -89,8 +92,9 @@ 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(kArbitraryFrameSinkId, LocalFrameId(1, 0)),
|
| - 1.f, gfx::Size(1, 1));
|
| + layer2->SetSurfaceId(
|
| + SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, kArbitraryToken)), 1.f,
|
| + gfx::Size(1, 1));
|
| layer_tree_host2->GetSurfaceSequenceGenerator()->set_frame_sink_id(
|
| FrameSinkId(2, 2));
|
| layer_tree_host2->SetRootLayer(layer2);
|
| @@ -111,8 +115,8 @@ TEST_F(SurfaceLayerTest, MultipleFramesOneSurface) {
|
|
|
| // Set of sequences that need to be satisfied should include sequences from
|
| // both trees.
|
| - EXPECT_TRUE(required_id ==
|
| - SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, 0)));
|
| + EXPECT_TRUE(required_id == SurfaceId(kArbitraryFrameSinkId,
|
| + LocalFrameId(1, kArbitraryToken)));
|
| EXPECT_EQ(2u, required_seq.size());
|
| EXPECT_TRUE(required_seq.count(expected1));
|
| EXPECT_TRUE(required_seq.count(expected2));
|
| @@ -141,8 +145,9 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
|
| layer_ = SurfaceLayer::Create(
|
| base::Bind(&SatisfyCallback, &satisfied_sequence_),
|
| base::Bind(&RequireCallback, &required_id_, &required_set_));
|
| - layer_->SetSurfaceId(SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, 0)),
|
| - 1.f, gfx::Size(1, 1));
|
| + layer_->SetSurfaceId(
|
| + SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, kArbitraryToken)), 1.f,
|
| + gfx::Size(1, 1));
|
|
|
| // Layer hasn't been added to tree so no SurfaceSequence generated yet.
|
| EXPECT_EQ(0u, required_set_.size());
|
| @@ -151,8 +156,8 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
|
|
|
| // Should have SurfaceSequence from first tree.
|
| SurfaceSequence expected(kArbitraryFrameSinkId, 1u);
|
| - EXPECT_TRUE(required_id_ ==
|
| - SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, 0)));
|
| + EXPECT_TRUE(required_id_ == SurfaceId(kArbitraryFrameSinkId,
|
| + LocalFrameId(1, kArbitraryToken)));
|
| EXPECT_EQ(1u, required_set_.size());
|
| EXPECT_TRUE(required_set_.count(expected));
|
|
|
| @@ -183,6 +188,8 @@ class SurfaceLayerSwapPromise : public LayerTreeTest {
|
|
|
| SurfaceId required_id_;
|
| std::set<SurfaceSequence> required_set_;
|
| + const base::UnguessableToken kArbitraryToken =
|
| + base::UnguessableToken::Create();
|
| };
|
|
|
| // Check that SurfaceSequence is sent through swap promise.
|
| @@ -219,8 +226,8 @@ class SurfaceLayerSwapPromiseWithDraw : public SurfaceLayerSwapPromise {
|
| }
|
|
|
| void AfterTest() override {
|
| - EXPECT_TRUE(required_id_ ==
|
| - SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, 0)));
|
| + EXPECT_TRUE(required_id_ == SurfaceId(kArbitraryFrameSinkId,
|
| + LocalFrameId(1, kArbitraryToken)));
|
| EXPECT_EQ(1u, required_set_.size());
|
| // Sequence should have been satisfied through Swap, not with the
|
| // callback.
|
| @@ -259,8 +266,8 @@ class SurfaceLayerSwapPromiseWithoutDraw : public SurfaceLayerSwapPromise {
|
| }
|
|
|
| void AfterTest() override {
|
| - EXPECT_TRUE(required_id_ ==
|
| - SurfaceId(kArbitraryFrameSinkId, LocalFrameId(1, 0)));
|
| + EXPECT_TRUE(required_id_ == SurfaceId(kArbitraryFrameSinkId,
|
| + LocalFrameId(1, kArbitraryToken)));
|
| EXPECT_EQ(1u, required_set_.size());
|
| // Sequence should have been satisfied with the callback.
|
| EXPECT_TRUE(satisfied_sequence_ ==
|
|
|