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

Unified Diff: content/renderer/media/buffered_data_source_unittest.cc

Issue 435023002: Revert "Revert 285479 "Make DataSource::Stop() synchronous."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « content/renderer/media/buffered_data_source.cc ('k') | media/base/data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/buffered_data_source_unittest.cc
diff --git a/content/renderer/media/buffered_data_source_unittest.cc b/content/renderer/media/buffered_data_source_unittest.cc
index 403a93b8308ea8d2ed8690c02d8f836b2229a9a7..73f8c3f6f378dafa801e3a18d7ee13ab1621e83d 100644
--- a/content/renderer/media/buffered_data_source_unittest.cc
+++ b/content/renderer/media/buffered_data_source_unittest.cc
@@ -178,7 +178,7 @@ class BufferedDataSourceTest : public testing::Test {
message_loop_.RunUntilIdle();
}
- data_source_->Stop(media::NewExpectedClosure());
+ data_source_->Stop();
message_loop_.RunUntilIdle();
}
@@ -505,31 +505,6 @@ TEST_F(BufferedDataSourceTest, File_Successful) {
Stop();
}
-static void SetTrue(bool* value) {
- *value = true;
-}
-
-// This test makes sure that Stop() does not require a task to run on
-// |message_loop_| before it calls its callback. This prevents accidental
-// introduction of a pipeline teardown deadlock. The pipeline owner blocks
-// the render message loop while waiting for Stop() to complete. Since this
-// object runs on the render message loop, Stop() will not complete if it
-// requires a task to run on the the message loop that is being blocked.
-TEST_F(BufferedDataSourceTest, StopDoesNotUseMessageLoopForCallback) {
- InitializeWith206Response();
-
- // Stop() the data source, using a callback that lets us verify that it was
- // called before Stop() returns. This is to make sure that the callback does
- // not require |message_loop_| to execute tasks before being called.
- bool stop_done_called = false;
- EXPECT_TRUE(data_source_->loading());
- data_source_->Stop(base::Bind(&SetTrue, &stop_done_called));
-
- // Verify that the callback was called inside the Stop() call.
- EXPECT_TRUE(stop_done_called);
- message_loop_.RunUntilIdle();
-}
-
TEST_F(BufferedDataSourceTest, StopDuringRead) {
InitializeWith206Response();
@@ -541,7 +516,7 @@ TEST_F(BufferedDataSourceTest, StopDuringRead) {
{
InSequence s;
EXPECT_CALL(*this, ReadCallback(media::DataSource::kReadError));
- data_source_->Stop(media::NewExpectedClosure());
+ data_source_->Stop();
}
message_loop_.RunUntilIdle();
}
« no previous file with comments | « content/renderer/media/buffered_data_source.cc ('k') | media/base/data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698