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 ppapi { |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 class TrackedMockResource : public MockResource { | 15 class TrackedMockResource : public MockResource { |
15 public: | 16 public: |
16 static int tracked_objects_alive; | 17 static int tracked_objects_alive; |
17 | 18 |
18 TrackedMockResource(PluginModule* module) : MockResource(module) { | 19 TrackedMockResource(PluginModule* module) : MockResource(module) { |
19 tracked_objects_alive++; | 20 tracked_objects_alive++; |
20 } | 21 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 tracker().ForceDeletePluginResourceRefs(pp_resource1); | 107 tracker().ForceDeletePluginResourceRefs(pp_resource1); |
107 tracker().ForceDeletePluginResourceRefs(pp_resource2); | 108 tracker().ForceDeletePluginResourceRefs(pp_resource2); |
108 EXPECT_EQ(0u, tracker().GetLiveObjectsForModule(module())); | 109 EXPECT_EQ(0u, tracker().GetLiveObjectsForModule(module())); |
109 | 110 |
110 // The resource we have a scoped_refptr to should still be alive. | 111 // The resource we have a scoped_refptr to should still be alive. |
111 ASSERT_EQ(1, TrackedMockResource::tracked_objects_alive); | 112 ASSERT_EQ(1, TrackedMockResource::tracked_objects_alive); |
112 resource1 = NULL; | 113 resource1 = NULL; |
113 ASSERT_EQ(0, TrackedMockResource::tracked_objects_alive); | 114 ASSERT_EQ(0, TrackedMockResource::tracked_objects_alive); |
114 } | 115 } |
115 | 116 |
116 } // namespace pepper | 117 } // namespace ppapi |
| 118 } // namespace webkit |
| 119 |
OLD | NEW |