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

Unified Diff: ppapi/shared_impl/resource_tracker_unittest.cc

Issue 19492014: PPAPI: Purposely leak ProxyLock, fix shutdown race (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove static initializer Created 7 years, 3 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 | « ppapi/shared_impl/proxy_lock.cc ('k') | ppapi/shared_impl/test_globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/resource_tracker_unittest.cc
diff --git a/ppapi/shared_impl/resource_tracker_unittest.cc b/ppapi/shared_impl/resource_tracker_unittest.cc
index fb00d761d6c33433c52a099a25098c8cf472f2de..3c7f90167cc8eddd955b5d2fa8d56b218deec8a5 100644
--- a/ppapi/shared_impl/resource_tracker_unittest.cc
+++ b/ppapi/shared_impl/resource_tracker_unittest.cc
@@ -5,6 +5,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "base/compiler_specific.h"
+#include "ppapi/shared_impl/proxy_lock.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/resource_tracker.h"
#include "ppapi/shared_impl/test_globals.h"
@@ -59,6 +60,7 @@ class ResourceTrackerTest : public testing::Test {
// deleted but the object lives on.
TEST_F(ResourceTrackerTest, LastPluginRef) {
PP_Instance instance = 0x1234567;
+ ProxyAutoLock lock;
resource_tracker().DidCreateInstance(instance);
scoped_refptr<MyMockResource> resource(new MyMockResource(instance));
@@ -81,6 +83,7 @@ TEST_F(ResourceTrackerTest, LastPluginRef) {
TEST_F(ResourceTrackerTest, InstanceDeletedWithPluginRef) {
// Make a resource with one ref held by the plugin, and delete the instance.
PP_Instance instance = 0x2345678;
+ ProxyAutoLock lock;
resource_tracker().DidCreateInstance(instance);
MyMockResource* resource = new MyMockResource(instance);
resource->GetReference();
@@ -99,6 +102,7 @@ TEST_F(ResourceTrackerTest, InstanceDeletedWithPluginRef) {
TEST_F(ResourceTrackerTest, InstanceDeletedWithBothRefed) {
// Create a new instance.
PP_Instance instance = 0x3456789;
+ ProxyAutoLock lock;
// Make a resource with one ref held by the plugin and one ref held by us
// (outlives the plugin), and delete the instance.
« no previous file with comments | « ppapi/shared_impl/proxy_lock.cc ('k') | ppapi/shared_impl/test_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698