Index: cc/tiles/tile_manager_unittest.cc |
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc |
index e68ea1ff7794b2e8780721d3e2793db846c475af..3fc608a6106dc0ec38d0b8e8ccf79d6d1a56f239 100644 |
--- a/cc/tiles/tile_manager_unittest.cc |
+++ b/cc/tiles/tile_manager_unittest.cc |
@@ -1423,12 +1423,13 @@ TEST_F(TileManagerTilePriorityQueueTest, RasterQueueAllUsesCorrectTileBounds) { |
class TileManagerTest : public testing::Test { |
public: |
- TileManagerTest() |
- : output_surface_(FakeOutputSurface::CreateSoftware( |
- make_scoped_ptr(new SoftwareOutputDevice))), |
- host_impl_(new MockLayerTreeHostImpl(&proxy_, |
- &shared_bitmap_manager_, |
- &task_graph_runner_)) { |
+ void SetUp() override { |
+ output_surface_ = FakeOutputSurface::CreateSoftware( |
+ make_scoped_ptr(new SoftwareOutputDevice)); |
+ LayerTreeSettings settings; |
+ CustomizeSettings(&settings); |
+ host_impl_.reset(new MockLayerTreeHostImpl( |
+ settings, &proxy_, &shared_bitmap_manager_, &task_graph_runner_)); |
host_impl_->InitializeRenderer(output_surface_.get()); |
} |
@@ -1436,14 +1437,18 @@ class TileManagerTest : public testing::Test { |
// MockLayerTreeHostImpl allows us to intercept tile manager callbacks. |
class MockLayerTreeHostImpl : public FakeLayerTreeHostImpl { |
public: |
- MockLayerTreeHostImpl(Proxy* proxy, |
+ MockLayerTreeHostImpl(const LayerTreeSettings& settings, |
+ Proxy* proxy, |
SharedBitmapManager* manager, |
TaskGraphRunner* task_graph_runner) |
- : FakeLayerTreeHostImpl(proxy, manager, task_graph_runner) {} |
+ : FakeLayerTreeHostImpl(settings, proxy, manager, task_graph_runner) {} |
MOCK_METHOD0(NotifyAllTileTasksCompleted, void()); |
}; |
+ // By default do no customization. |
+ virtual void CustomizeSettings(LayerTreeSettings* settings) {} |
+ |
TestSharedBitmapManager shared_bitmap_manager_; |
TestTaskGraphRunner task_graph_runner_; |
FakeImplProxy proxy_; |
@@ -1601,9 +1606,16 @@ class CancellingTileTaskRunner : public TileTaskRunner, public TileTaskClient { |
~CancellingTileTaskRunner() override {} |
}; |
+class PartialRasterTileManagerTest : public TileManagerTest { |
+ public: |
+ void CustomizeSettings(LayerTreeSettings* settings) override { |
+ settings->enable_partial_raster = true; |
+ } |
+}; |
+ |
// Ensures that if a raster task is cancelled, it gets returned to the resource |
// pool with an invalid content ID, not with its invalidated content ID. |
-TEST_F(TileManagerTest, CancelledTasksHaveNoContentId) { |
+TEST_F(PartialRasterTileManagerTest, CancelledTasksHaveNoContentId) { |
// Create a CancellingTaskRunner and set it on the tile manager so that all |
// scheduled work is immediately cancelled. |
CancellingTileTaskRunner cancelling_runner; |