+ // Run all pending tasks to let the the test clean up before the test ends.
+ // This is due to that
+ // FrameWriterDelegate::FrameWriterDelegate::DeliverFrame use
+ // PostTaskAndReply to the IO thread and expects the reply to process
+ // on the main render thread to clean up its resources. However, the
+ // QuitClosure above ends before that.
+ base::MessageLoop::current()->RunUntilIdle();