test_globals.cc revision 4e180b6a0b4720a9b8e9e959a882386f690f08ff
1// Copyright (c) 2012 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/shared_impl/test_globals.h" 6 7namespace ppapi { 8 9TestGlobals::TestGlobals() 10 : ppapi::PpapiGlobals(), 11 resource_tracker_(ResourceTracker::THREAD_SAFE), 12 callback_tracker_(new CallbackTracker) { 13} 14 15TestGlobals::TestGlobals(PpapiGlobals::PerThreadForTest per_thread_for_test) 16 : ppapi::PpapiGlobals(per_thread_for_test), 17 resource_tracker_(ResourceTracker::THREAD_SAFE), 18 callback_tracker_(new CallbackTracker) { 19} 20 21TestGlobals::~TestGlobals() { 22} 23 24ResourceTracker* TestGlobals::GetResourceTracker() { 25 return &resource_tracker_; 26} 27 28VarTracker* TestGlobals::GetVarTracker() { 29 return &var_tracker_; 30} 31 32CallbackTracker* TestGlobals::GetCallbackTrackerForInstance( 33 PP_Instance instance) { 34 return callback_tracker_.get(); 35} 36 37thunk::PPB_Instance_API* TestGlobals::GetInstanceAPI( 38 PP_Instance instance) { 39 return NULL; 40} 41 42thunk::ResourceCreationAPI* TestGlobals::GetResourceCreationAPI( 43 PP_Instance instance) { 44 return NULL; 45} 46 47PP_Module TestGlobals::GetModuleForInstance(PP_Instance instance) { 48 return 0; 49} 50 51std::string TestGlobals::GetCmdLine() { 52 return std::string(); 53} 54 55void TestGlobals::PreCacheFontForFlash(const void* /* logfontw */) { 56} 57 58void TestGlobals::LogWithSource(PP_Instance instance, 59 PP_LogLevel level, 60 const std::string& source, 61 const std::string& value) { 62} 63 64void TestGlobals::BroadcastLogWithSource(PP_Module module, 65 PP_LogLevel level, 66 const std::string& source, 67 const std::string& value) { 68} 69 70MessageLoopShared* TestGlobals::GetCurrentMessageLoop() { 71 return NULL; 72} 73 74base::TaskRunner* TestGlobals::GetFileTaskRunner() { 75 return NULL; 76} 77 78bool TestGlobals::IsHostGlobals() const { 79 // Pretend to be the host-side, for code that expects one or the other. 80 // TODO(dmichael): just make it settable which one we're pretending to be? 81 return true; 82} 83 84} // namespace ppapi 85