| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/plugins/ppapi_unittest.h" | 5 #include "webkit/plugins/ppapi/ppapi_unittest.h" |
| 6 | 6 |
| 7 #include "webkit/glue/plugins/pepper_resource_tracker.h" | 7 #include "webkit/plugins/ppapi/resource_tracker.h" |
| 8 #include "webkit/glue/plugins/mock_resource.h" | 8 #include "webkit/plugins/ppapi/mock_resource.h" |
| 9 | 9 |
| 10 namespace pepper { | 10 namespace webkit { |
| 11 namespace plugins { |
| 12 namespace ppapi { |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 class TrackedMockResource : public MockResource { | 16 class TrackedMockResource : public MockResource { |
| 15 public: | 17 public: |
| 16 static int tracked_objects_alive; | 18 static int tracked_objects_alive; |
| 17 | 19 |
| 18 TrackedMockResource(PluginModule* module) : MockResource(module) { | 20 TrackedMockResource(PluginModule* module) : MockResource(module) { |
| 19 tracked_objects_alive++; | 21 tracked_objects_alive++; |
| 20 } | 22 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 tracker().ForceDeletePluginResourceRefs(pp_resource1); | 108 tracker().ForceDeletePluginResourceRefs(pp_resource1); |
| 107 tracker().ForceDeletePluginResourceRefs(pp_resource2); | 109 tracker().ForceDeletePluginResourceRefs(pp_resource2); |
| 108 EXPECT_EQ(0u, tracker().GetLiveObjectsForModule(module())); | 110 EXPECT_EQ(0u, tracker().GetLiveObjectsForModule(module())); |
| 109 | 111 |
| 110 // The resource we have a scoped_refptr to should still be alive. | 112 // The resource we have a scoped_refptr to should still be alive. |
| 111 ASSERT_EQ(1, TrackedMockResource::tracked_objects_alive); | 113 ASSERT_EQ(1, TrackedMockResource::tracked_objects_alive); |
| 112 resource1 = NULL; | 114 resource1 = NULL; |
| 113 ASSERT_EQ(0, TrackedMockResource::tracked_objects_alive); | 115 ASSERT_EQ(0, TrackedMockResource::tracked_objects_alive); |
| 114 } | 116 } |
| 115 | 117 |
| 116 } // namespace pepper | 118 } // namespace ppapi |
| 119 } // namespace plugins |
| 120 } // namespace webkit |
| 121 |
| OLD | NEW |