Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / renderer / media / webrtc / video_destination_handler_unittest.cc
index 041071f..806b6f4 100644 (file)
@@ -41,7 +41,7 @@ class VideoDestinationHandlerTest : public PpapiUnittest {
     registry_->Init(kTestStreamUrl);
   }
 
-  virtual void TearDown() OVERRIDE {
+  void TearDown() override {
     registry_.reset();
     blink::WebHeap::collectAllGarbageForTesting();
     PpapiUnittest::TearDown();
@@ -98,9 +98,14 @@ TEST_F(VideoDestinationHandlerTest, PutFrame) {
         RunClosure(quit_closure));
     frame_writer->PutFrame(image.get(), 10);
     run_loop.Run();
+    // 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();
   }
-  // TODO(perkj): Verify that the track output I420 when
-  // https://codereview.chromium.org/213423006/ is landed.
   EXPECT_EQ(1, sink.number_of_frames());
   native_track->RemoveSink(&sink);