Index: cc/tiles/tile_manager_unittest.cc |
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc |
index d36a7824fe3f6cb1e97cf3045951b71e62a4d1af..0584bb7a0ca39dce85c44822909ff291b3c9b967 100644 |
--- a/cc/tiles/tile_manager_unittest.cc |
+++ b/cc/tiles/tile_manager_unittest.cc |
@@ -2527,6 +2527,11 @@ TEST_F(CheckerImagingTileManagerTest, BuildsImageDecodeQueueAsExpected) { |
gfx::Rect(rect_to_raster)); // Eventually rect. |
host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); |
+ // Finish all raster and dispatch completion callback so that the decode work |
+ // for checkered images can be scheduled. |
+ static_cast<SynchronousTaskGraphRunner*>(task_graph_runner())->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
+ |
// Run decode tasks to trigger completion of any pending decodes. |
FlushDecodeTasks(); |
@@ -2636,6 +2641,11 @@ TEST_F(CheckerImagingTileManagerMemoryTest, AddsAllNowTilesToImageDecodeQueue) { |
complete_tiling_rect); // Eventually rect. |
host_impl()->tile_manager()->PrepareTiles(host_impl()->global_tile_state()); |
+ // Finish all raster work so the decode work for checkered images can be |
+ // scheduled. |
+ static_cast<SynchronousTaskGraphRunner*>(task_graph_runner())->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
+ |
// Flush all decode tasks. The tiles with checkered images should be |
// invalidated. |
FlushDecodeTasks(); |