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

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

Issue 120893002: Eliminate video capture thread in renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test-fix Created 6 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
Index: content/renderer/media/video_capture_impl_manager_unittest.cc
diff --git a/content/renderer/media/video_capture_impl_manager_unittest.cc b/content/renderer/media/video_capture_impl_manager_unittest.cc
index 33b9935d8c5ffe4c7ad24fe5530d5f1c972f452b..dded2756c53eb1b962d86003873ef5808a1f766b 100644
--- a/content/renderer/media/video_capture_impl_manager_unittest.cc
+++ b/content/renderer/media/video_capture_impl_manager_unittest.cc
@@ -140,9 +140,32 @@ TEST_F(VideoCaptureImplManagerTest, MultipleClients) {
handle2->StopCapture(client2.get());
run_loop.Run();
}
-
EXPECT_TRUE(device1 == device2);
+
EXPECT_CALL(*static_cast<MockVideoCaptureImpl*>(device1), Destruct());
+
+ // We have to wait until MockVideoCaptureImpl is destroyed. Because we
+ // use gmock to expect destruction to happen. Otherwise TSAN will
+ // complain. This unfortunately means that we have to know the
+ // destruction sequence of VideoCaptureImpl.
Ami GONE FROM CHROMIUM 2014/01/13 18:26:37 If the thing you're trying to assert here is that
+
+ {
+ // Make sure there's no more task on the main thread.
+ // Destruction is now posted on the IO thread.
+ base::RunLoop run_loop;
+ handle1.reset();
+ handle2.reset();
+ run_loop.RunUntilIdle();
+ }
+ {
+ // Make sure there's no more task on the IO thread.
+ // VideoCaptureImpl is now destroyed.
+ base::RunLoop run_loop;
+ child_process_->io_message_loop_proxy()->PostTask(
+ FROM_HERE,
+ BindToCurrentLoop(run_loop.QuitClosure()));
+ run_loop.Run();
+ }
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698