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

Side by Side Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 6206001: Merge 70669 - Don't uninitialize FFmpegVideoDecodeEngine if we haven't initia... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/597/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <deque> 5 #include <deque>
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "media/base/data_buffer.h" 10 #include "media/base/data_buffer.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 stream_.r_frame_rate.num = 1; 153 stream_.r_frame_rate.num = 1;
154 stream_.r_frame_rate.den = 1; 154 stream_.r_frame_rate.den = 1;
155 buffer_ = new DataBuffer(1); 155 buffer_ = new DataBuffer(1);
156 end_of_stream_buffer_ = new DataBuffer(0); 156 end_of_stream_buffer_ = new DataBuffer(0);
157 157
158 // Initialize MockFFmpeg. 158 // Initialize MockFFmpeg.
159 MockFFmpeg::set(&mock_ffmpeg_); 159 MockFFmpeg::set(&mock_ffmpeg_);
160 } 160 }
161 161
162 virtual ~FFmpegVideoDecoderTest() { 162 virtual ~FFmpegVideoDecoderTest() {
163 // We had to set this because not all tests had initialized the engine.
164 engine_->event_handler_ = decoder_.get();
165 EXPECT_CALL(callback_, OnFilterCallback()); 163 EXPECT_CALL(callback_, OnFilterCallback());
166 EXPECT_CALL(callback_, OnCallbackDestroyed()); 164 EXPECT_CALL(callback_, OnCallbackDestroyed());
167 EXPECT_CALL(*engine_, Uninitialize()) 165
168 .WillOnce(EngineUninitialize(engine_)); 166 // The presence of an event handler means we need to uninitialize.
167 if (engine_->event_handler_) {
168 EXPECT_CALL(*engine_, Uninitialize())
169 .WillOnce(EngineUninitialize(engine_));
170 }
171
169 decoder_->Stop(callback_.NewCallback()); 172 decoder_->Stop(callback_.NewCallback());
170 173
171 // Finish up any remaining tasks. 174 // Finish up any remaining tasks.
172 message_loop_.RunAllPending(); 175 message_loop_.RunAllPending();
173 176
174 // Reset MockFFmpeg. 177 // Reset MockFFmpeg.
175 MockFFmpeg::set(NULL); 178 MockFFmpeg::set(NULL);
176 } 179 }
177 180
178 void InitializeDecoderSuccessfully() { 181 void InitializeDecoderSuccessfully() {
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 EXPECT_CALL(seek_done_cb, OnCallbackDestroyed()); 507 EXPECT_CALL(seek_done_cb, OnCallbackDestroyed());
505 decoder_->Seek(kZero, seek_done_cb.NewCallback()); 508 decoder_->Seek(kZero, seek_done_cb.NewCallback());
506 509
507 510
508 EXPECT_TRUE(decoder_->pts_heap_.IsEmpty()); 511 EXPECT_TRUE(decoder_->pts_heap_.IsEmpty());
509 EXPECT_EQ(FFmpegVideoDecoder::kNormal, decoder_->state_); 512 EXPECT_EQ(FFmpegVideoDecoder::kNormal, decoder_->state_);
510 } 513 }
511 } 514 }
512 515
513 } // namespace media 516 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698