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

Unified Diff: cc/tiles/tile_manager_unittest.cc

Issue 1381163002: Add a flag to disable partial raster in renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove "--enable-persistent-gpu-memory-buffer" Created 5 years, 2 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
Index: cc/tiles/tile_manager_unittest.cc
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc
index 0a0cb60684f127354bdc036b759bebb8071bc372..8df7021b85312e7aeb98aa9dd0a6a78dfa91ca42 100644
--- a/cc/tiles/tile_manager_unittest.cc
+++ b/cc/tiles/tile_manager_unittest.cc
@@ -1439,12 +1439,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());
}
@@ -1452,14 +1453,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_;
@@ -1617,9 +1622,16 @@ class CancellingTileTaskRunner : public TileTaskRunner, public TileTaskClient {
~CancellingTileTaskRunner() override {}
};
+class PartialRasterTileManagerTest : public TileManagerTest {
+ public:
+ void CustomizeSettings(LayerTreeSettings* settings) override {
+ settings->use_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;

Powered by Google App Engine
This is Rietveld 408576698