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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppapi_proxy_test.h ('k') | ppapi/proxy/ppb_audio_config_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/proxy/ppapi_proxy_test.h"
6
7 #include "ppapi/c/pp_errors.h"
8
9 namespace pp {
10 namespace proxy {
11
12 namespace {
13
14 const void* MockGetInterface(const char*) {
15 return NULL;
16 }
17
18 int32_t MockInitModule(PP_Module, Dispatcher::GetInterfaceFunc) {
19 return PP_OK;
20 }
21
22 void MockShutdownModuleFunc() {
23 }
24
25 } // namespace
26
27 PluginProxyTest::PluginProxyTest() {
28 }
29
30 PluginProxyTest::~PluginProxyTest() {
31 }
32
33 void PluginProxyTest::SetUp() {
34 // These must be first since the dispatcher set-up uses them.
35 PluginResourceTracker::SetInstanceForTest(&resource_tracker_);
36 PluginVarTracker::SetInstanceForTest(&var_tracker_);
37
38 pp_instance_ = 0x1234;
39 plugin_dispatcher_.reset(new PluginDispatcher(
40 base::Process::Current().handle(),
41 &MockGetInterface,
42 &MockInitModule,
43 &MockShutdownModuleFunc));
44 plugin_dispatcher_->InitWithTestSink(&sink_);
45 // When the plugin dispatcher is per-instance, this is the line to use:
46 // PluginDispatcher::SetForInstance(pp_instance_, plugin_dispatcher_.get());
47 PluginDispatcher::SetGlobal(plugin_dispatcher_.get());
48 }
49
50 void PluginProxyTest::TearDown() {
51 PluginDispatcher::SetGlobal(NULL);
52 plugin_dispatcher_.reset();
53
54 PluginVarTracker::SetInstanceForTest(NULL);
55 PluginResourceTracker::SetInstanceForTest(NULL);
56 }
57
58 } // namespace proxy
59 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_proxy_test.h ('k') | ppapi/proxy/ppb_audio_config_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698