Index: ppapi/proxy/ppapi_proxy_test.cc |
diff --git a/ppapi/proxy/ppapi_proxy_test.cc b/ppapi/proxy/ppapi_proxy_test.cc |
index 8ab8c36153455d7b13b7c150b330e21f0b23048e..955f1edd993c7638c7a49ec54f356b6cc1af964b 100644 |
--- a/ppapi/proxy/ppapi_proxy_test.cc |
+++ b/ppapi/proxy/ppapi_proxy_test.cc |
@@ -139,7 +139,8 @@ bool ProxyTestHarnessBase::SupportsInterface(const char* name) { |
// PluginProxyTestHarness ------------------------------------------------------ |
-PluginProxyTestHarness::PluginProxyTestHarness() { |
+PluginProxyTestHarness::PluginProxyTestHarness() |
+ : plugin_globals_(PpapiGlobals::ForTest()) { |
} |
PluginProxyTestHarness::~PluginProxyTestHarness() { |
@@ -151,6 +152,7 @@ Dispatcher* PluginProxyTestHarness::GetDispatcher() { |
void PluginProxyTestHarness::SetUpHarness() { |
// These must be first since the dispatcher set-up uses them. |
+ PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); |
resource_tracker().DidCreateInstance(pp_instance()); |
plugin_dispatcher_.reset(new PluginDispatcher( |
@@ -166,6 +168,7 @@ void PluginProxyTestHarness::SetUpHarnessWithChannel( |
base::WaitableEvent* shutdown_event, |
bool is_client) { |
// These must be first since the dispatcher set-up uses them. |
+ PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); |
resource_tracker().DidCreateInstance(pp_instance()); |
plugin_delegate_mock_.Init(ipc_message_loop, shutdown_event); |
@@ -248,7 +251,8 @@ void PluginProxyTest::TearDown() { |
// HostProxyTestHarness -------------------------------------------------------- |
-HostProxyTestHarness::HostProxyTestHarness() { |
+HostProxyTestHarness::HostProxyTestHarness() |
+ : host_globals_(PpapiGlobals::ForTest()) { |
} |
HostProxyTestHarness::~HostProxyTestHarness() { |
@@ -259,6 +263,8 @@ Dispatcher* HostProxyTestHarness::GetDispatcher() { |
} |
void HostProxyTestHarness::SetUpHarness() { |
+ // These must be first since the dispatcher set-up uses them. |
+ PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); |
host_dispatcher_.reset(new HostDispatcher( |
base::Process::Current().handle(), |
pp_module(), |
@@ -272,7 +278,10 @@ void HostProxyTestHarness::SetUpHarnessWithChannel( |
base::MessageLoopProxy* ipc_message_loop, |
base::WaitableEvent* shutdown_event, |
bool is_client) { |
+ // These must be first since the dispatcher set-up uses them. |
+ PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); |
delegate_mock_.Init(ipc_message_loop, shutdown_event); |
+ |
host_dispatcher_.reset(new HostDispatcher( |
base::Process::Current().handle(), |
pp_module(), |
@@ -345,7 +354,6 @@ void TwoWayTest::SetUp() { |
IPC::ChannelHandle handle; |
handle.name = "TwoWayTestChannel"; |
- |
base::WaitableEvent remote_harness_set_up(true, false); |
plugin_thread_.message_loop_proxy()->PostTask( |
FROM_HERE, |