| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/process.h" | 6 #include "base/process.h" |
| 7 #include "ppapi/proxy/mock_resource.h" | 7 #include "ppapi/proxy/mock_resource.h" |
| 8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
| 9 #include "ppapi/proxy/plugin_resource_tracker.h" | 9 #include "ppapi/proxy/plugin_resource_tracker.h" |
| 10 #include "ppapi/proxy/ppapi_messages.h" | 10 #include "ppapi/proxy/ppapi_messages.h" |
| 11 #include "ppapi/proxy/ppapi_proxy_test.h" | 11 #include "ppapi/proxy/ppapi_proxy_test.h" |
| 12 | 12 |
| 13 using ppapi::HostResource; |
| 14 |
| 13 namespace pp { | 15 namespace pp { |
| 14 namespace proxy { | 16 namespace proxy { |
| 15 | 17 |
| 16 namespace { | 18 namespace { |
| 17 | 19 |
| 18 // Object so we know when a resource has been released. | 20 // Object so we know when a resource has been released. |
| 19 class TrackedMockResource : public MockResource { | 21 class TrackedMockResource : public MockResource { |
| 20 public: | 22 public: |
| 21 TrackedMockResource(const HostResource& serialized) | 23 TrackedMockResource(const HostResource& serialized) |
| 22 : MockResource(serialized) { | 24 : MockResource(serialized) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 tracker().PluginResourceForHostResource(serialized)); | 66 tracker().PluginResourceForHostResource(serialized)); |
| 65 | 67 |
| 66 // Releasing the resource should have freed it. | 68 // Releasing the resource should have freed it. |
| 67 tracker().ReleaseResource(plugin_resource); | 69 tracker().ReleaseResource(plugin_resource); |
| 68 EXPECT_EQ(0, TrackedMockResource::tracked_alive_count); | 70 EXPECT_EQ(0, TrackedMockResource::tracked_alive_count); |
| 69 EXPECT_EQ(0, tracker().PluginResourceForHostResource(serialized)); | 71 EXPECT_EQ(0, tracker().PluginResourceForHostResource(serialized)); |
| 70 } | 72 } |
| 71 | 73 |
| 72 } // namespace proxy | 74 } // namespace proxy |
| 73 } // namespace pp | 75 } // namespace pp |
| OLD | NEW |