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

Unified Diff: media/base/bind_to_loop_unittest.cc

Issue 27420004: Remove threading from RendererGpuVideoAcceleratorFactories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dthread
Patch Set: 2d3efbfa Rebase. Created 7 years, 2 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: media/base/bind_to_loop_unittest.cc
diff --git a/media/base/bind_to_loop_unittest.cc b/media/base/bind_to_loop_unittest.cc
index 0c7a3ddd19418fd12ba920e627c321d964f96406..19346ce1203dfbe6200d561c18fa55099fe05ada 100644
--- a/media/base/bind_to_loop_unittest.cc
+++ b/media/base/bind_to_loop_unittest.cc
@@ -6,6 +6,7 @@
#include "base/message_loop/message_loop.h"
#include "base/synchronization/waitable_event.h"
+#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
@@ -166,4 +167,20 @@ TEST_F(BindToLoopTest, Integers) {
EXPECT_EQ(b, -1);
}
+TEST_F(BindToLoopTest, BindSyncDeadlock) {
+ // Check that we don't deadlock using BindToLoopSync().
+ bool bool_val = false;
+ base::Thread thread("SyncDeadlock");
+ thread.Start();
+ scoped_refptr<base::MessageLoopProxy> thread_proxy =
+ thread.message_loop_proxy();
+ base::Closure cb = BindToLoopSync(
+ thread_proxy,
+ base::Bind(&BoundBoolSet, &bool_val, true));
+ EXPECT_FALSE(bool_val);
+ cb.Run();
+ EXPECT_TRUE(bool_val);
+ thread.Stop();
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698