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

Unified Diff: ppapi/proxy/ppapi_proxy_test.cc

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
Index: ppapi/proxy/ppapi_proxy_test.cc
===================================================================
--- ppapi/proxy/ppapi_proxy_test.cc (revision 0)
+++ ppapi/proxy/ppapi_proxy_test.cc (revision 0)
@@ -0,0 +1,59 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/proxy/ppapi_proxy_test.h"
+
+#include "ppapi/c/pp_errors.h"
+
+namespace pp {
+namespace proxy {
+
+namespace {
+
+const void* MockGetInterface(const char*) {
+ return NULL;
+}
+
+int32_t MockInitModule(PP_Module, Dispatcher::GetInterfaceFunc) {
+ return PP_OK;
+}
+
+void MockShutdownModuleFunc() {
+}
+
+} // namespace
+
+PluginProxyTest::PluginProxyTest() {
+}
+
+PluginProxyTest::~PluginProxyTest() {
+}
+
+void PluginProxyTest::SetUp() {
+ // These must be first since the dispatcher set-up uses them.
+ PluginResourceTracker::SetInstanceForTest(&resource_tracker_);
+ PluginVarTracker::SetInstanceForTest(&var_tracker_);
+
+ pp_instance_ = 0x1234;
+ plugin_dispatcher_.reset(new PluginDispatcher(
+ base::Process::Current().handle(),
+ &MockGetInterface,
+ &MockInitModule,
+ &MockShutdownModuleFunc));
+ plugin_dispatcher_->InitWithTestSink(&sink_);
+ // When the plugin dispatcher is per-instance, this is the line to use:
+ // PluginDispatcher::SetForInstance(pp_instance_, plugin_dispatcher_.get());
+ PluginDispatcher::SetGlobal(plugin_dispatcher_.get());
+}
+
+void PluginProxyTest::TearDown() {
+ PluginDispatcher::SetGlobal(NULL);
+ plugin_dispatcher_.reset();
+
+ PluginVarTracker::SetInstanceForTest(NULL);
+ PluginResourceTracker::SetInstanceForTest(NULL);
+}
+
+} // namespace proxy
+} // namespace pp
Property changes on: ppapi/proxy/ppapi_proxy_test.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698