| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
| 8 #include "base/time.h" | 8 #include "base/time.h" |
| 9 #include "ppapi/c/dev/ppb_var_deprecated.h" | 9 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| 10 #include "ppapi/c/dev/ppp_class_deprecated.h" | 10 #include "ppapi/c/dev/ppp_class_deprecated.h" |
| 11 #include "ppapi/c/pp_var.h" | 11 #include "ppapi/c/pp_var.h" |
| 12 #include "ppapi/c/ppb_var.h" | 12 #include "ppapi/c/ppb_var.h" |
| 13 #include "ppapi/c/ppp_instance.h" | 13 #include "ppapi/c/ppp_instance.h" |
| 14 #include "ppapi/c/private/ppp_instance_private.h" | 14 #include "ppapi/c/private/ppp_instance_private.h" |
| 15 #include "ppapi/proxy/host_dispatcher.h" | 15 #include "ppapi/proxy/host_dispatcher.h" |
| 16 #include "ppapi/proxy/interface_list.h" |
| 16 #include "ppapi/proxy/ppapi_proxy_test.h" | 17 #include "ppapi/proxy/ppapi_proxy_test.h" |
| 18 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 17 #include "ppapi/shared_impl/ppb_var_shared.h" | 19 #include "ppapi/shared_impl/ppb_var_shared.h" |
| 18 #include "ppapi/shared_impl/var.h" | 20 #include "ppapi/shared_impl/var.h" |
| 19 | 21 |
| 20 namespace ppapi { | 22 namespace ppapi { |
| 21 | 23 |
| 22 // A fake version of NPObjectVar for testing. | 24 // A fake version of NPObjectVar for testing. |
| 23 class NPObjectVar : public ppapi::Var { | 25 class NPObjectVar : public ppapi::Var { |
| 24 public: | 26 public: |
| 25 NPObjectVar() {} | 27 NPObjectVar() {} |
| 26 virtual ~NPObjectVar() {} | 28 virtual ~NPObjectVar() {} |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 #ifdef ENABLE_PEPPER_THREADING | 154 #ifdef ENABLE_PEPPER_THREADING |
| 153 TEST_F(PPP_Instance_Private_ProxyTest, PPPInstancePrivate) { | 155 TEST_F(PPP_Instance_Private_ProxyTest, PPPInstancePrivate) { |
| 154 #else | 156 #else |
| 155 TEST_F(PPP_Instance_Private_ProxyTest, DISABLED_PPPInstancePrivate) { | 157 TEST_F(PPP_Instance_Private_ProxyTest, DISABLED_PPPInstancePrivate) { |
| 156 #endif | 158 #endif |
| 157 // This test controls its own instance; we can't use the one that | 159 // This test controls its own instance; we can't use the one that |
| 158 // PluginProxyTestHarness provides. | 160 // PluginProxyTestHarness provides. |
| 159 ASSERT_NE(kInstance, pp_instance()); | 161 ASSERT_NE(kInstance, pp_instance()); |
| 160 HostDispatcher::SetForInstance(kInstance, host().host_dispatcher()); | 162 HostDispatcher::SetForInstance(kInstance, host().host_dispatcher()); |
| 161 | 163 |
| 164 // Requires dev interfaces. |
| 165 InterfaceList::SetProcessGlobalPermissions( |
| 166 PpapiPermissions::AllPermissions()); |
| 167 |
| 162 // This file-local global is used by the PPP_Instance mock above in order to | 168 // This file-local global is used by the PPP_Instance mock above in order to |
| 163 // access PPB_Var_Deprecated. | 169 // access PPB_Var_Deprecated. |
| 164 plugin_dispatcher = plugin().plugin_dispatcher(); | 170 plugin_dispatcher = plugin().plugin_dispatcher(); |
| 165 | 171 |
| 166 // Grab the host-side proxy for PPP_Instance and PPP_Instance_Private. | 172 // Grab the host-side proxy for PPP_Instance and PPP_Instance_Private. |
| 167 const PPP_Instance_Private* ppp_instance_private = | 173 const PPP_Instance_Private* ppp_instance_private = |
| 168 static_cast<const PPP_Instance_Private*>( | 174 static_cast<const PPP_Instance_Private*>( |
| 169 host().host_dispatcher()->GetProxiedInterface( | 175 host().host_dispatcher()->GetProxiedInterface( |
| 170 PPP_INSTANCE_PRIVATE_INTERFACE)); | 176 PPP_INSTANCE_PRIVATE_INTERFACE)); |
| 171 const PPP_Instance_1_1* ppp_instance = static_cast<const PPP_Instance_1_1*>( | 177 const PPP_Instance_1_1* ppp_instance = static_cast<const PPP_Instance_1_1*>( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // Destroy the instance. DidDestroy above decrements the reference count for | 209 // Destroy the instance. DidDestroy above decrements the reference count for |
| 204 // instance_obj, so it should also be destroyed. | 210 // instance_obj, so it should also be destroyed. |
| 205 ppp_instance->DidDestroy(kInstance); | 211 ppp_instance->DidDestroy(kInstance); |
| 206 EXPECT_EQ(-1, plugin().var_tracker().GetRefCountForObject(instance_obj)); | 212 EXPECT_EQ(-1, plugin().var_tracker().GetRefCountForObject(instance_obj)); |
| 207 EXPECT_EQ(-1, host().var_tracker().GetRefCountForObject(host_pp_var)); | 213 EXPECT_EQ(-1, host().var_tracker().GetRefCountForObject(host_pp_var)); |
| 208 } | 214 } |
| 209 | 215 |
| 210 } // namespace proxy | 216 } // namespace proxy |
| 211 } // namespace ppapi | 217 } // namespace ppapi |
| 212 | 218 |
| OLD | NEW |