summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppapi_proxy_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/proxy/ppapi_proxy_test.cc')
-rw-r--r--ppapi/proxy/ppapi_proxy_test.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc
index 00947e3..9034d8f 100644
--- a/ppapi/proxy/ppapi_proxy_test.cc
+++ b/ppapi/proxy/ppapi_proxy_test.cc
@@ -171,6 +171,8 @@ Dispatcher* PluginProxyTestHarness::GetDispatcher() {
void PluginProxyTestHarness::SetUpHarness() {
// These must be first since the dispatcher set-up uses them.
CreatePluginGlobals();
+ // Some of the methods called during set-up check that the lock is held.
+ ProxyAutoLock lock;
resource_tracker().DidCreateInstance(pp_instance());
@@ -196,6 +198,8 @@ void PluginProxyTestHarness::SetUpHarnessWithChannel(
bool is_client) {
// These must be first since the dispatcher set-up uses them.
CreatePluginGlobals();
+ // Some of the methods called during set-up check that the lock is held.
+ ProxyAutoLock lock;
resource_tracker().DidCreateInstance(pp_instance());
plugin_delegate_mock_.Init(ipc_message_loop, shutdown_event);
@@ -214,10 +218,15 @@ void PluginProxyTestHarness::SetUpHarnessWithChannel(
}
void PluginProxyTestHarness::TearDownHarness() {
- plugin_dispatcher_->DidDestroyInstance(pp_instance());
- plugin_dispatcher_.reset();
+ {
+ // Some of the methods called during tear-down check that the lock is held.
+ ProxyAutoLock lock;
+
+ plugin_dispatcher_->DidDestroyInstance(pp_instance());
+ plugin_dispatcher_.reset();
- resource_tracker().DidDeleteInstance(pp_instance());
+ resource_tracker().DidDeleteInstance(pp_instance());
+ }
plugin_globals_.reset();
}