Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: content/renderer/media/webrtc/video_destination_handler_unittest.cc

Issue 264363005: Cast: deliver video frames on the IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test again Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/child/child_process.h" 10 #include "content/child/child_process.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 blink::WebVector<blink::WebMediaStreamTrack> video_tracks; 71 blink::WebVector<blink::WebMediaStreamTrack> video_tracks;
72 test_stream.videoTracks(video_tracks); 72 test_stream.videoTracks(video_tracks);
73 ASSERT_EQ(1u, video_tracks.size()); 73 ASSERT_EQ(1u, video_tracks.size());
74 74
75 // Verify the native video track has been added. 75 // Verify the native video track has been added.
76 MediaStreamVideoTrack* native_track = 76 MediaStreamVideoTrack* native_track =
77 MediaStreamVideoTrack::GetVideoTrack(video_tracks[0]); 77 MediaStreamVideoTrack::GetVideoTrack(video_tracks[0]);
78 ASSERT_TRUE(native_track != NULL); 78 ASSERT_TRUE(native_track != NULL);
79 79
80 MockMediaStreamVideoSink sink; 80 MockMediaStreamVideoSink sink;
81 native_track->AddSink(&sink); 81 native_track->AddSink(&sink, sink.GetDeliverFrameCB());
82 82 scoped_refptr<PPB_ImageData_Impl> image(
83 scoped_refptr<PPB_ImageData_Impl> image(
84 new PPB_ImageData_Impl(instance()->pp_instance(), 83 new PPB_ImageData_Impl(instance()->pp_instance(),
85 PPB_ImageData_Impl::ForTest())); 84 PPB_ImageData_Impl::ForTest()));
86 image->Init(PP_IMAGEDATAFORMAT_BGRA_PREMUL, 640, 360, true); 85 image->Init(PP_IMAGEDATAFORMAT_BGRA_PREMUL, 640, 360, true);
87 { 86 {
88 base::RunLoop run_loop; 87 base::RunLoop run_loop;
89 base::Closure quit_closure = run_loop.QuitClosure(); 88 base::Closure quit_closure = run_loop.QuitClosure();
90 89
91 EXPECT_CALL(sink, OnVideoFrame()).WillOnce( 90 EXPECT_CALL(sink, OnVideoFrame()).WillOnce(
92 RunClosure(quit_closure)); 91 RunClosure(quit_closure));
93 frame_writer->PutFrame(image, 10); 92 frame_writer->PutFrame(image, 10);
94 run_loop.Run(); 93 run_loop.Run();
95 } 94 }
96 // TODO(perkj): Verify that the track output I420 when 95 // TODO(perkj): Verify that the track output I420 when
97 // https://codereview.chromium.org/213423006/ is landed. 96 // https://codereview.chromium.org/213423006/ is landed.
98 EXPECT_EQ(1, sink.number_of_frames()); 97 EXPECT_EQ(1, sink.number_of_frames());
99 native_track->RemoveSink(&sink); 98 native_track->RemoveSink(&sink);
100 99
101 // The |frame_writer| is a proxy and is owned by whoever call Open. 100 // The |frame_writer| is a proxy and is owned by whoever call Open.
102 delete frame_writer; 101 delete frame_writer;
103 } 102 }
104 103
105 } // namespace content 104 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698