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

Unified Diff: ppapi/proxy/ppapi_proxy_test.h

Issue 9034035: Make it possible to have 1 PpapiGlobals per thread. Update unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 8 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
« no previous file with comments | « ppapi/proxy/plugin_var_tracker.cc ('k') | ppapi/proxy/ppapi_proxy_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppapi_proxy_test.h
diff --git a/ppapi/proxy/ppapi_proxy_test.h b/ppapi/proxy/ppapi_proxy_test.h
index 2a612ed73a6f81bea858e41d62cd8941ec02ecb4..77697b54a52cec34e4fb82f93e362edcc7437ca7 100644
--- a/ppapi/proxy/ppapi_proxy_test.h
+++ b/ppapi/proxy/ppapi_proxy_test.h
@@ -17,6 +17,7 @@
#include "ppapi/proxy/plugin_proxy_delegate.h"
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/plugin_var_tracker.h"
+#include "ppapi/shared_impl/test_globals.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace ppapi {
@@ -33,6 +34,7 @@ class ProxyTestHarnessBase {
PP_Instance pp_instance() const { return pp_instance_; }
IPC::TestSink& sink() { return sink_; }
+ virtual PpapiGlobals* GetGlobals() = 0;
// Returns either the plugin or host dispatcher, depending on the test.
virtual Dispatcher* GetDispatcher() = 0;
@@ -88,6 +90,7 @@ class PluginProxyTestHarness : public ProxyTestHarnessBase {
}
// ProxyTestHarnessBase implementation.
+ virtual PpapiGlobals* GetGlobals() { return &plugin_globals_; }
virtual Dispatcher* GetDispatcher();
virtual void SetUpHarness();
virtual void SetUpHarnessWithChannel(const IPC::ChannelHandle& channel_handle,
@@ -157,8 +160,15 @@ class HostProxyTestHarness : public ProxyTestHarnessBase {
virtual ~HostProxyTestHarness();
HostDispatcher* host_dispatcher() { return host_dispatcher_.get(); }
+ ResourceTracker& resource_tracker() {
+ return *host_globals_.GetResourceTracker();
+ }
+ VarTracker& var_tracker() {
+ return *host_globals_.GetVarTracker();
+ }
// ProxyTestBase implementation.
+ virtual PpapiGlobals* GetGlobals() { return &host_globals_; }
virtual Dispatcher* GetDispatcher();
virtual void SetUpHarness();
virtual void SetUpHarnessWithChannel(const IPC::ChannelHandle& channel_handle,
@@ -191,6 +201,7 @@ class HostProxyTestHarness : public ProxyTestHarnessBase {
};
private:
+ ppapi::TestGlobals host_globals_;
scoped_ptr<HostDispatcher> host_dispatcher_;
DelegateMock delegate_mock_;
};
« no previous file with comments | « ppapi/proxy/plugin_var_tracker.cc ('k') | ppapi/proxy/ppapi_proxy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698