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

Side by Side Diff: media/base/composite_filter_unittest.cc

Issue 9310028: Update AudioRenderer, VideoRenderer, and AudioDecoder Initialize() methods to use PipelineStatusCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix AudioRendererImplTest Created 8 years, 10 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/base/composite_filter.cc ('k') | media/base/filters.h » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "media/base/composite_filter.h" 7 #include "media/base/composite_filter.h"
8 #include "media/base/mock_callback.h" 8 #include "media/base/mock_callback.h"
9 #include "media/base/mock_filter_host.h" 9 #include "media/base/mock_filter_host.h"
10 #include "media/base/mock_filters.h" 10 #include "media/base/mock_filters.h"
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 741
742 // Run callback to indicate that |filter_2_|'s Stop() has completed. 742 // Run callback to indicate that |filter_2_|'s Stop() has completed.
743 RunFilter2Callback(); 743 RunFilter2Callback();
744 } 744 }
745 745
746 TEST_F(CompositeFilterTest, TestErrorWhilePlaying) { 746 TEST_F(CompositeFilterTest, TestErrorWhilePlaying) {
747 InSequence sequence; 747 InSequence sequence;
748 748
749 SetupAndAdd2Filters(); 749 SetupAndAdd2Filters();
750 750
751 // Simulate an error on |filter_2_| while in kCreated state. This
752 // can happen if an error occurs during filter initialization.
753 EXPECT_CALL(*mock_filter_host_, SetError(PIPELINE_ERROR_OUT_OF_MEMORY));
754 filter_2_->host()->SetError(PIPELINE_ERROR_OUT_OF_MEMORY);
755
756 DoPlay(); 751 DoPlay();
757 752
758 // Simulate an error on |filter_2_| while playing. 753 // Simulate an error on |filter_2_| while playing.
759 EXPECT_CALL(*mock_filter_host_, SetError(PIPELINE_ERROR_OUT_OF_MEMORY)); 754 EXPECT_CALL(*mock_filter_host_, SetError(PIPELINE_ERROR_OUT_OF_MEMORY));
760 filter_2_->host()->SetError(PIPELINE_ERROR_OUT_OF_MEMORY); 755 filter_2_->host()->SetError(PIPELINE_ERROR_OUT_OF_MEMORY);
761 756
762 DoPause(); 757 DoPause();
763 758
764 // Simulate an error on |filter_2_| while paused. 759 // Simulate an error on |filter_2_| while paused.
765 EXPECT_CALL(*mock_filter_host_, SetError(PIPELINE_ERROR_NETWORK)); 760 EXPECT_CALL(*mock_filter_host_, SetError(PIPELINE_ERROR_NETWORK));
(...skipping 27 matching lines...) Expand all
793 NewExpectedStatusCB(PIPELINE_OK)); 788 NewExpectedStatusCB(PIPELINE_OK));
794 789
795 // Issue a Play() and expect no errors. 790 // Issue a Play() and expect no errors.
796 composite_->Play(NewExpectedClosure()); 791 composite_->Play(NewExpectedClosure());
797 792
798 // Issue a Stop() and expect no errors. 793 // Issue a Stop() and expect no errors.
799 composite_->Stop(NewExpectedClosure()); 794 composite_->Stop(NewExpectedClosure());
800 } 795 }
801 796
802 } // namespace media 797 } // namespace media
OLDNEW
« no previous file with comments | « media/base/composite_filter.cc ('k') | media/base/filters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698