Index: content/renderer/media/webrtc/video_destination_handler_unittest.cc |
diff --git a/content/renderer/media/webrtc/video_destination_handler_unittest.cc b/content/renderer/media/webrtc/video_destination_handler_unittest.cc |
index 041071f84785f1d9d5b27100c81e19ad82cb59fd..afaa6f1ba4a8ca4cb9068537847b8ac4ab9dbd73 100644 |
--- a/content/renderer/media/webrtc/video_destination_handler_unittest.cc |
+++ b/content/renderer/media/webrtc/video_destination_handler_unittest.cc |
@@ -57,21 +57,20 @@ class VideoDestinationHandlerTest : public PpapiUnittest { |
}; |
TEST_F(VideoDestinationHandlerTest, Open) { |
- FrameWriterInterface* frame_writer = NULL; |
+ VideoDestinationHandler::FrameWriterCallback frame_writer; |
+ |
// Unknow url will return false. |
EXPECT_FALSE(VideoDestinationHandler::Open(registry_.get(), |
kUnknownStreamUrl, &frame_writer)); |
EXPECT_TRUE(VideoDestinationHandler::Open(registry_.get(), |
kTestStreamUrl, &frame_writer)); |
- // The |frame_writer| is a proxy and is owned by whoever call Open. |
- delete frame_writer; |
} |
TEST_F(VideoDestinationHandlerTest, PutFrame) { |
- FrameWriterInterface* frame_writer = NULL; |
+ VideoDestinationHandler::FrameWriterCallback frame_writer; |
EXPECT_TRUE(VideoDestinationHandler::Open(registry_.get(), |
kTestStreamUrl, &frame_writer)); |
- ASSERT_TRUE(frame_writer); |
+ ASSERT_FALSE(frame_writer.is_null()); |
// Verify the video track has been added. |
const blink::WebMediaStream test_stream = registry_->test_stream(); |
@@ -86,7 +85,7 @@ TEST_F(VideoDestinationHandlerTest, PutFrame) { |
MockMediaStreamVideoSink sink; |
native_track->AddSink(&sink, sink.GetDeliverFrameCB()); |
- scoped_refptr<PPB_ImageData_Impl> image( |
+ scoped_refptr<PPB_ImageData_Impl> image( |
new PPB_ImageData_Impl(instance()->pp_instance(), |
PPB_ImageData_Impl::ForTest())); |
image->Init(PP_IMAGEDATAFORMAT_BGRA_PREMUL, 640, 360, true); |
@@ -96,16 +95,11 @@ TEST_F(VideoDestinationHandlerTest, PutFrame) { |
EXPECT_CALL(sink, OnVideoFrame()).WillOnce( |
RunClosure(quit_closure)); |
- frame_writer->PutFrame(image.get(), 10); |
+ frame_writer.Run(image.get(), 10); |
run_loop.Run(); |
} |
- // 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); |
- |
- // The |frame_writer| is a proxy and is owned by whoever call Open. |
- delete frame_writer; |
} |
} // namespace content |