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

Unified Diff: media/filters/pipeline_controller_unittest.cc

Issue 2564253002: Notify HTMLMediaElement when media pipeline init has finished
Patch Set: Created 4 years 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/pipeline_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/pipeline_controller_unittest.cc
diff --git a/media/filters/pipeline_controller_unittest.cc b/media/filters/pipeline_controller_unittest.cc
index 6a7d2e998416089ea1177b21e49163c6d7542e6a..312ed34a5137ec21ee9fc408aa9475a361638680 100644
--- a/media/filters/pipeline_controller_unittest.cc
+++ b/media/filters/pipeline_controller_unittest.cc
@@ -35,17 +35,22 @@ class PipelineControllerTest : public ::testing::Test, public Pipeline::Client {
: pipeline_controller_(&pipeline_,
base::Bind(&PipelineControllerTest::CreateRenderer,
base::Unretained(this)),
+ base::Bind(&PipelineControllerTest::OnStartDone,
+ base::Unretained(this)),
base::Bind(&PipelineControllerTest::OnSeeked,
base::Unretained(this)),
base::Bind(&PipelineControllerTest::OnSuspended,
base::Unretained(this)),
base::Bind(&PipelineControllerTest::OnError,
- base::Unretained(this))) {}
+ base::Unretained(this))) {
+ EXPECT_CALL(*this, OnError(_)).Times(0);
+ }
~PipelineControllerTest() override {}
PipelineStatusCB StartPipeline(bool is_streaming, bool is_static) {
EXPECT_FALSE(pipeline_controller_.IsStable());
+ EXPECT_CALL(*this, OnStartDone(_)).Times(1);
PipelineStatusCB start_cb;
EXPECT_CALL(pipeline_, Start(_, _, _, _)).WillOnce(SaveArg<3>(&start_cb));
pipeline_controller_.Start(&demuxer_, this, is_streaming, is_static);
@@ -117,10 +122,12 @@ class PipelineControllerTest : public ::testing::Test, public Pipeline::Client {
last_seeked_time_updated_ = time_updated;
}
+ MOCK_METHOD1(OnStartDone, void(PipelineStatus status));
+
void OnSuspended() { was_suspended_ = true; }
// Pipeline::Client overrides
- void OnError(PipelineStatus status) override { NOTREACHED(); }
+ MOCK_METHOD1(OnError, void(PipelineStatus status));
void OnEnded() override {}
void OnMetadata(PipelineMetadata metadata) override {}
void OnBufferingStateChange(BufferingState state) override {}
@@ -156,6 +163,13 @@ TEST_F(PipelineControllerTest, Startup) {
EXPECT_TRUE(pipeline_controller_.IsStable());
}
+TEST_F(PipelineControllerTest, StartupFailed) {
+ EXPECT_CALL(*this, OnError(PIPELINE_ERROR_INITIALIZATION_FAILED)).Times(1);
+ PipelineStatusCB start_cb = StartPipeline();
+ start_cb.Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
+ base::RunLoop().RunUntilIdle();
+}
+
TEST_F(PipelineControllerTest, SuspendResume) {
Complete(StartPipeline());
EXPECT_TRUE(was_seeked_);
« no previous file with comments | « media/filters/pipeline_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698