Commit 0c5169a7 authored by scherkus@chromium.org's avatar scherkus@chromium.org

Add a lot of Pipeline tests to cover stopping/error handling while in a variety of states.

While the use of gmock's InSequence is unfortunate (read: brittle tests), it does help capture the call sequences for various pipeline operations. You may notice in the original incarnation of these tests in http://codereview.chromium.org/10828045/ didn't need InSequence. I'm aiming to remove InSequence after I'm done rewriting the guts of Pipeline.

BUG=110228

Review URL: https://chromiumcodereview.appspot.com/10832197

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150816 0039d316-1c4b-4281-b951-d872f2087c98
parent a9fa69b6
......@@ -274,11 +274,6 @@ class MockFilterCollection {
DISALLOW_COPY_AND_ASSIGN(MockFilterCollection);
};
// Helper gmock action that calls SetError() on behalf of the provided filter.
ACTION_P2(SetError, filter, error) {
filter->host()->SetError(error);
}
ACTION(RunClosure) {
arg0.Run();
}
......
......@@ -260,6 +260,10 @@ void Pipeline::SetClockForTesting(Clock* clock) {
clock_.reset(clock);
}
void Pipeline::SetErrorForTesting(PipelineStatus status) {
SetError(status);
}
void Pipeline::SetState(State next_state) {
if (state_ != kStarted && next_state == kStarted &&
!creation_time_.is_null()) {
......
......@@ -217,6 +217,7 @@ class MEDIA_EXPORT Pipeline
PipelineStatistics GetStatistics() const;
void SetClockForTesting(Clock* clock);
void SetErrorForTesting(PipelineStatus status);
private:
FRIEND_TEST_ALL_PREFIXES(PipelineTest, GetBufferedTimeRanges);
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment