| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |