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

Unified Diff: cc/layers/layer_list_iterator_unittest.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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/layer_iterator_unittest.cc ('k') | cc/layers/layer_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_list_iterator_unittest.cc
diff --git a/cc/layers/layer_list_iterator_unittest.cc b/cc/layers/layer_list_iterator_unittest.cc
index 97b2cd558c5f9beb307b43393d692ac6168c889a..d0985096cb822d24e6b552c6234c8346d2ee7dbb 100644
--- a/cc/layers/layer_list_iterator_unittest.cc
+++ b/cc/layers/layer_list_iterator_unittest.cc
@@ -4,8 +4,9 @@
#include "cc/layers/layer_list_iterator.h"
+#include <memory>
+
#include "base/containers/adapters.h"
-#include "base/memory/scoped_ptr.h"
#include "cc/test/fake_impl_task_runner_provider.h"
#include "cc/test/fake_layer_tree_host_impl.h"
#include "cc/test/fake_output_surface.h"
@@ -22,7 +23,7 @@ TEST(LayerListIteratorTest, VerifyTraversalOrder) {
FakeImplTaskRunnerProvider task_runner_provider;
TestSharedBitmapManager shared_bitmap_manager;
TestTaskGraphRunner task_graph_runner;
- scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
+ std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
&task_graph_runner);
host_impl.SetVisible(true);
@@ -37,13 +38,20 @@ TEST(LayerListIteratorTest, VerifyTraversalOrder) {
// +-6
// +-7
// We expect to visit all seven layers in that order.
- scoped_ptr<LayerImpl> layer1 = LayerImpl::Create(host_impl.active_tree(), 1);
- scoped_ptr<LayerImpl> layer2 = LayerImpl::Create(host_impl.active_tree(), 2);
- scoped_ptr<LayerImpl> layer3 = LayerImpl::Create(host_impl.active_tree(), 3);
- scoped_ptr<LayerImpl> layer4 = LayerImpl::Create(host_impl.active_tree(), 4);
- scoped_ptr<LayerImpl> layer5 = LayerImpl::Create(host_impl.active_tree(), 5);
- scoped_ptr<LayerImpl> layer6 = LayerImpl::Create(host_impl.active_tree(), 6);
- scoped_ptr<LayerImpl> layer7 = LayerImpl::Create(host_impl.active_tree(), 7);
+ std::unique_ptr<LayerImpl> layer1 =
+ LayerImpl::Create(host_impl.active_tree(), 1);
+ std::unique_ptr<LayerImpl> layer2 =
+ LayerImpl::Create(host_impl.active_tree(), 2);
+ std::unique_ptr<LayerImpl> layer3 =
+ LayerImpl::Create(host_impl.active_tree(), 3);
+ std::unique_ptr<LayerImpl> layer4 =
+ LayerImpl::Create(host_impl.active_tree(), 4);
+ std::unique_ptr<LayerImpl> layer5 =
+ LayerImpl::Create(host_impl.active_tree(), 5);
+ std::unique_ptr<LayerImpl> layer6 =
+ LayerImpl::Create(host_impl.active_tree(), 6);
+ std::unique_ptr<LayerImpl> layer7 =
+ LayerImpl::Create(host_impl.active_tree(), 7);
layer2->AddChild(std::move(layer3));
layer2->AddChild(std::move(layer4));
@@ -68,14 +76,15 @@ TEST(LayerListIteratorTest, VerifySingleLayer) {
FakeImplTaskRunnerProvider task_runner_provider;
TestSharedBitmapManager shared_bitmap_manager;
TestTaskGraphRunner task_graph_runner;
- scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
+ std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
&task_graph_runner);
host_impl.SetVisible(true);
EXPECT_TRUE(host_impl.InitializeRenderer(output_surface.get()));
// This test constructs a tree consisting of a single layer.
- scoped_ptr<LayerImpl> layer1 = LayerImpl::Create(host_impl.active_tree(), 1);
+ std::unique_ptr<LayerImpl> layer1 =
+ LayerImpl::Create(host_impl.active_tree(), 1);
host_impl.active_tree()->SetRootLayer(std::move(layer1));
int i = 1;
@@ -102,7 +111,7 @@ TEST(LayerListReverseIteratorTest, VerifyTraversalOrder) {
FakeImplTaskRunnerProvider task_runner_provider;
TestSharedBitmapManager shared_bitmap_manager;
TestTaskGraphRunner task_graph_runner;
- scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
+ std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
&task_graph_runner);
host_impl.SetVisible(true);
@@ -117,13 +126,20 @@ TEST(LayerListReverseIteratorTest, VerifyTraversalOrder) {
// +-6
// +-7
// We expect to visit all seven layers in reverse order.
- scoped_ptr<LayerImpl> layer1 = LayerImpl::Create(host_impl.active_tree(), 1);
- scoped_ptr<LayerImpl> layer2 = LayerImpl::Create(host_impl.active_tree(), 2);
- scoped_ptr<LayerImpl> layer3 = LayerImpl::Create(host_impl.active_tree(), 3);
- scoped_ptr<LayerImpl> layer4 = LayerImpl::Create(host_impl.active_tree(), 4);
- scoped_ptr<LayerImpl> layer5 = LayerImpl::Create(host_impl.active_tree(), 5);
- scoped_ptr<LayerImpl> layer6 = LayerImpl::Create(host_impl.active_tree(), 6);
- scoped_ptr<LayerImpl> layer7 = LayerImpl::Create(host_impl.active_tree(), 7);
+ std::unique_ptr<LayerImpl> layer1 =
+ LayerImpl::Create(host_impl.active_tree(), 1);
+ std::unique_ptr<LayerImpl> layer2 =
+ LayerImpl::Create(host_impl.active_tree(), 2);
+ std::unique_ptr<LayerImpl> layer3 =
+ LayerImpl::Create(host_impl.active_tree(), 3);
+ std::unique_ptr<LayerImpl> layer4 =
+ LayerImpl::Create(host_impl.active_tree(), 4);
+ std::unique_ptr<LayerImpl> layer5 =
+ LayerImpl::Create(host_impl.active_tree(), 5);
+ std::unique_ptr<LayerImpl> layer6 =
+ LayerImpl::Create(host_impl.active_tree(), 6);
+ std::unique_ptr<LayerImpl> layer7 =
+ LayerImpl::Create(host_impl.active_tree(), 7);
layer2->AddChild(std::move(layer3));
layer2->AddChild(std::move(layer4));
@@ -150,14 +166,15 @@ TEST(LayerListReverseIteratorTest, VerifySingleLayer) {
FakeImplTaskRunnerProvider task_runner_provider;
TestSharedBitmapManager shared_bitmap_manager;
TestTaskGraphRunner task_graph_runner;
- scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
+ std::unique_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d();
FakeLayerTreeHostImpl host_impl(&task_runner_provider, &shared_bitmap_manager,
&task_graph_runner);
host_impl.SetVisible(true);
EXPECT_TRUE(host_impl.InitializeRenderer(output_surface.get()));
// This test constructs a tree consisting of a single layer.
- scoped_ptr<LayerImpl> layer1 = LayerImpl::Create(host_impl.active_tree(), 1);
+ std::unique_ptr<LayerImpl> layer1 =
+ LayerImpl::Create(host_impl.active_tree(), 1);
host_impl.active_tree()->SetRootLayer(std::move(layer1));
int i = 1;
« no previous file with comments | « cc/layers/layer_iterator_unittest.cc ('k') | cc/layers/layer_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698