Chromium Code Reviews| Index: cc/layers/picture_layer_unittest.cc |
| diff --git a/cc/layers/picture_layer_unittest.cc b/cc/layers/picture_layer_unittest.cc |
| index 8260999bcef81727603c1c226f73d82e558caaca..d9e62b07afb23a37fa1d4ba8453f55a075cd3ac7 100644 |
| --- a/cc/layers/picture_layer_unittest.cc |
| +++ b/cc/layers/picture_layer_unittest.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/thread_task_runner_handle.h" |
| #include "cc/layers/content_layer_client.h" |
| #include "cc/layers/picture_layer_impl.h" |
| +#include "cc/test/fake_display_list_recording_source.h" |
| #include "cc/test/fake_layer_tree_host.h" |
| #include "cc/test/fake_picture_layer.h" |
| #include "cc/test/fake_picture_layer_impl.h" |
| @@ -77,22 +78,28 @@ TEST(PictureLayerTest, NoTilesIfEmptyBounds) { |
| } |
| TEST(PictureLayerTest, SuitableForGpuRasterization) { |
| + scoped_ptr<FakeDisplayListRecordingSource> fake_recording_source( |
| + new FakeDisplayListRecordingSource(gfx::Size(100, 100))); |
| MockContentLayerClient client; |
| - scoped_refptr<PictureLayer> layer = |
| - PictureLayer::Create(LayerSettings(), &client); |
| + scoped_refptr<FakePictureLayer> layer = |
| + FakePictureLayer::CreateWithRecordingSource(LayerSettings(), &client, |
| + fake_recording_source.Pass()); |
| + |
| FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); |
| TestTaskGraphRunner task_graph_runner; |
| scoped_ptr<FakeLayerTreeHost> host = |
| FakeLayerTreeHost::Create(&host_client, &task_graph_runner); |
| host->SetRootLayer(layer); |
| - RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); |
| + FakeDisplayListRecordingSource* recording_source = |
|
danakj
2015/09/16 23:04:49
nit: can you grab this pointer before you Pass it
pdr.
2015/09/17 20:52:45
Good idea. Done.
|
| + static_cast<FakeDisplayListRecordingSource*>( |
| + layer->GetRecordingSourceForTesting()); |
| // Layer is suitable for gpu rasterization by default. |
| EXPECT_TRUE(recording_source->IsSuitableForGpuRasterization()); |
| EXPECT_TRUE(layer->IsSuitableForGpuRasterization()); |
| // Veto gpu rasterization. |
| - recording_source->SetUnsuitableForGpuRasterizationForTesting(); |
| + recording_source->SetUnsuitableForGpuRasterization(); |
| EXPECT_FALSE(recording_source->IsSuitableForGpuRasterization()); |
|
hendrikw
2015/09/16 23:15:57
This part of the test is a bit weird for me, we se
danakj
2015/09/16 23:20:50
Ya this EXPECT could go away. This test is basical
|
| EXPECT_FALSE(layer->IsSuitableForGpuRasterization()); |
| } |