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

Unified Diff: media/filters/pipeline_controller_unittest.cc

Issue 2618883002: [Media, Video] Enable the video track for a new renderer. (Closed)
Patch Set: Fixed debug tests Created 3 years, 11 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/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..fe2f1585db6bca8e45fc645463942ec4b7e6a4a6 100644
--- a/media/filters/pipeline_controller_unittest.cc
+++ b/media/filters/pipeline_controller_unittest.cc
@@ -39,6 +39,10 @@ class PipelineControllerTest : public ::testing::Test, public Pipeline::Client {
base::Unretained(this)),
base::Bind(&PipelineControllerTest::OnSuspended,
base::Unretained(this)),
+ base::Bind(&PipelineControllerTest::OnBeforeResume,
+ base::Unretained(this)),
+ base::Bind(&PipelineControllerTest::OnResumed,
+ base::Unretained(this)),
base::Bind(&PipelineControllerTest::OnError,
base::Unretained(this))) {}
@@ -118,6 +122,8 @@ class PipelineControllerTest : public ::testing::Test, public Pipeline::Client {
}
void OnSuspended() { was_suspended_ = true; }
+ void OnBeforeResume() { was_resuming_ = true; }
+ void OnResumed() { was_resumed_ = true; }
// Pipeline::Client overrides
void OnError(PipelineStatus status) override { NOTREACHED(); }
@@ -140,6 +146,8 @@ class PipelineControllerTest : public ::testing::Test, public Pipeline::Client {
bool was_seeked_ = false;
bool last_seeked_time_updated_ = false;
bool was_suspended_ = false;
+ bool was_resuming_ = false;
+ bool was_resumed_ = false;
base::TimeDelta last_resume_time_;
DISALLOW_COPY_AND_ASSIGN(PipelineControllerTest);
@@ -165,7 +173,12 @@ TEST_F(PipelineControllerTest, SuspendResume) {
EXPECT_TRUE(was_suspended_);
EXPECT_FALSE(pipeline_controller_.IsStable());
- Complete(ResumePipeline());
+ PipelineStatusCB resume_cb = ResumePipeline();
+ EXPECT_TRUE(was_resuming_);
+ EXPECT_FALSE(was_resumed_);
+
+ Complete(resume_cb);
+ EXPECT_TRUE(was_resumed_);
EXPECT_TRUE(pipeline_controller_.IsStable());
// |was_seeked_| should not be affected by Suspend()/Resume() at all.
« 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