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

Unified Diff: media/filters/audio_renderer_base_unittest.cc

Issue 159476: Merge 21611 - Implemented proper pausethenseek behaviour for the media pipeli... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 5 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 | « media/filters/audio_renderer_base.cc ('k') | media/filters/decoder_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_renderer_base_unittest.cc
===================================================================
--- media/filters/audio_renderer_base_unittest.cc (revision 21798)
+++ media/filters/audio_renderer_base_unittest.cc (working copy)
@@ -95,9 +95,9 @@
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
- // Initialize, we expect to get a bunch of read requests.
+ // Initialize, we expect to have no reads.
renderer_->Initialize(decoder_, callback_.NewCallback());
- EXPECT_EQ(kMaxQueueSize, read_queue_.size());
+ EXPECT_EQ(0u, read_queue_.size());
}
TEST_F(AudioRendererBaseTest, Initialize_Successful) {
@@ -107,18 +107,26 @@
EXPECT_CALL(*renderer_, OnInitialize(_))
.WillOnce(Return(true));
- // Set up a check point to verify that the callback hasn't been executed yet.
- EXPECT_CALL(*renderer_, CheckPoint(0));
-
- // After finishing preroll, we expect our callback to be executed.
+ // After finishing initialization, we expect our callback to be executed.
EXPECT_CALL(callback_, OnFilterCallback());
EXPECT_CALL(callback_, OnCallbackDestroyed());
- // Initialize, we expect to get a bunch of read requests.
+ // Verify the following expectations haven't run until we complete the reads.
+ EXPECT_CALL(*renderer_, CheckPoint(0));
+
+ MockFilterCallback seek_callback;
+ EXPECT_CALL(seek_callback, OnFilterCallback());
+ EXPECT_CALL(seek_callback, OnCallbackDestroyed());
+
+ // Initialize, we shouldn't have any reads.
renderer_->Initialize(decoder_, callback_.NewCallback());
+ EXPECT_EQ(0u, read_queue_.size());
+
+ // Now seek to trigger prerolling.
+ renderer_->Seek(base::TimeDelta(), seek_callback.NewCallback());
EXPECT_EQ(kMaxQueueSize, read_queue_.size());
- // Verify our callback hasn't been executed yet.
+ // Verify our seek callback hasn't been executed yet.
renderer_->CheckPoint(0);
// Now satisfy the read requests. Our callback should be executed after
Property changes on: media\filters\audio_renderer_base_unittest.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /trunk/src/media/filters/audio_renderer_base_unittest.cc:r21611
Merged /branches/chrome_webkit_merge_branch/media/filters/audio_renderer_base_unittest.cc:r69-2775
« no previous file with comments | « media/filters/audio_renderer_base.cc ('k') | media/filters/decoder_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698