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

Unified Diff: content/renderer/media/rtc_video_decoder_unittest.cc

Issue 144303004: Revert of Revert of Revert of Remove threading from RendererGpuVideoAcceleratorFactories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dthread
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/rtc_video_decoder_factory.cc ('k') | content/renderer/media/rtc_video_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_decoder_unittest.cc
diff --git a/content/renderer/media/rtc_video_decoder_unittest.cc b/content/renderer/media/rtc_video_decoder_unittest.cc
index 240391dd421c317ff2492592830760cf78b1593b..6f91756c371a4907312f8227ca043f53e436e161 100644
--- a/content/renderer/media/rtc_video_decoder_unittest.cc
+++ b/content/renderer/media/rtc_video_decoder_unittest.cc
@@ -43,6 +43,7 @@
EXPECT_CALL(*mock_gpu_factories_,
DoCreateVideoDecodeAccelerator(media::VP8PROFILE_MAIN, _))
.WillRepeatedly(Return(mock_vda_));
+ EXPECT_CALL(*mock_gpu_factories_, Abort()).WillRepeatedly(Return());
EXPECT_CALL(*mock_gpu_factories_, CreateSharedMemory(_))
.WillRepeatedly(Return(static_cast<base::SharedMemory*>(NULL)));
EXPECT_CALL(*mock_vda_, Destroy());
@@ -52,12 +53,15 @@
virtual void TearDown() OVERRIDE {
VLOG(2) << "TearDown";
- EXPECT_TRUE(vda_thread_.IsRunning());
- RunUntilIdle(); // Wait until all callbascks complete.
- vda_task_runner_->DeleteSoon(FROM_HERE, rtc_decoder_.release());
- // Make sure the decoder is released before stopping the thread.
- RunUntilIdle();
- vda_thread_.Stop();
+ if (vda_thread_.IsRunning()) {
+ RunUntilIdle(); // Wait until all callbascks complete.
+ vda_task_runner_->DeleteSoon(FROM_HERE, rtc_decoder_.release());
+ // Make sure the decoder is released before stopping the thread.
+ RunUntilIdle();
+ vda_thread_.Stop();
+ } else {
+ rtc_decoder_.reset();
+ }
}
virtual int32_t Decoded(webrtc::I420VideoFrame& decoded_image) OVERRIDE {
@@ -161,6 +165,8 @@
Initialize();
EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, rtc_decoder_->Release());
}
+
+TEST_F(RTCVideoDecoderTest, VdaThreadStops) { vda_thread_.Stop(); }
TEST_F(RTCVideoDecoderTest, IsBufferAfterReset) {
EXPECT_TRUE(rtc_decoder_->IsBufferAfterReset(0, RTCVideoDecoder::ID_INVALID));
« no previous file with comments | « content/renderer/media/rtc_video_decoder_factory.cc ('k') | content/renderer/media/rtc_video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698