diff options
Diffstat (limited to 'cc/trees/layer_tree_host_unittest.cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index 8c6633a..4e194fd 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -272,101 +272,6 @@ class LayerTreeHostTestReadyToDrawNonEmpty // single threaded mode. SINGLE_THREAD_TEST_F(LayerTreeHostTestReadyToDrawNonEmpty); -// Test if the LTHI successfully recieves the NotifyAllTileTasksCompleted -// callback for a call of PrepareTiles. -class LayerTreeHostNotifyAllTileTasksCompletedOnPrepareTiles - : public LayerTreeHostTest { - public: - LayerTreeHostNotifyAllTileTasksCompletedOnPrepareTiles() - : notify_all_tile_tasks_completed_called_(false) {} - void BeginTest() override { - // Logic is handled in InitializedRendererOnThread to ensure that our - // LTHI is fully set up. - } - - void AfterTest() override { - EXPECT_TRUE(notify_all_tile_tasks_completed_called_); - } - - void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, - bool success) override { - host_impl->PrepareTiles(); - } - - void NotifyAllTileTasksCompleted(LayerTreeHostImpl* host_impl) override { - // We only expect this to be called once. - DCHECK(!notify_all_tile_tasks_completed_called_); - notify_all_tile_tasks_completed_called_ = true; - EndTest(); - } - - private: - bool notify_all_tile_tasks_completed_called_; -}; - -SINGLE_AND_MULTI_THREAD_TEST_F( - LayerTreeHostNotifyAllTileTasksCompletedOnPrepareTiles); - -// Test if the LTHI successfully recieves the NotifyAllTileTasksCompleted -// callback for a call of PrepareTiles while using the "needs more work" path. -class LayerTreeHostNotifyAllTileTasksCompletedOnPrepareMoreTiles - : public LayerTreeHostNotifyAllTileTasksCompletedOnPrepareTiles { - public: - void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, - bool success) override { - host_impl->PrepareTiles(); - host_impl->tile_manager()->SetMoreTilesNeedToBeRasterizedForTesting(); - } -}; - -SINGLE_AND_MULTI_THREAD_TEST_F( - LayerTreeHostNotifyAllTileTasksCompletedOnPrepareMoreTiles); - -// Test that AreAllTileTasksCompleted returnes the expected values before and -// after PrepareTiles. -class LayerTreeHostAreAllTileTasksCompleted : public LayerTreeHostTest { - public: - LayerTreeHostAreAllTileTasksCompleted() : got_notify_(false) {} - - void SetupTree() override { - client_.set_fill_with_nonsolid_color(true); - scoped_refptr<FakePictureLayer> root_layer = - FakePictureLayer::Create(layer_settings(), &client_); - root_layer->SetBounds(gfx::Size(1500, 1500)); - root_layer->SetIsDrawable(true); - - layer_tree_host()->SetRootLayer(root_layer); - layer_tree_host()->SetViewportSize(gfx::Size(16, 16)); - LayerTreeHostTest::SetupTree(); - } - - void BeginTest() override { PostSetNeedsCommitToMainThread(); } - - void AfterTest() override { EXPECT_TRUE(got_notify_); } - - void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { - // Before commit, we should have no work. - EXPECT_FALSE(host_impl->tile_manager()->HasScheduledTileTasksForTesting()); - } - - void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { - // Immediately after commit, we should have enqueued work. - EXPECT_TRUE(host_impl->tile_manager()->HasScheduledTileTasksForTesting()); - } - - void NotifyAllTileTasksCompleted(LayerTreeHostImpl* host_impl) override { - EXPECT_FALSE(host_impl->tile_manager()->HasScheduledTileTasksForTesting()); - got_notify_ = true; - EndTest(); - } - - private: - FakeContentLayerClient client_; - bool got_notify_; -}; - -SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostAreAllTileTasksCompleted); - class LayerTreeHostFreeWorkerContextResourcesTest : public LayerTreeHostTest { public: scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface() override { |