| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "ppapi/shared_impl/resource.h" | 8 #include "ppapi/shared_impl/resource.h" |
| 9 #include "ppapi/shared_impl/resource_tracker.h" | 9 #include "ppapi/shared_impl/resource_tracker.h" |
| 10 #include "ppapi/shared_impl/tracker_base.h" | 10 #include "ppapi/shared_impl/tracker_base.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 PP_Instance inst, | 67 PP_Instance inst, |
| 68 ppapi::proxy::InterfaceID id) OVERRIDE { | 68 ppapi::proxy::InterfaceID id) OVERRIDE { |
| 69 return NULL; | 69 return NULL; |
| 70 } | 70 } |
| 71 virtual VarTracker* GetVarTracker() OVERRIDE { | 71 virtual VarTracker* GetVarTracker() OVERRIDE { |
| 72 return NULL; | 72 return NULL; |
| 73 } | 73 } |
| 74 virtual ResourceTracker* GetResourceTracker() OVERRIDE { | 74 virtual ResourceTracker* GetResourceTracker() OVERRIDE { |
| 75 return &resource_tracker_; | 75 return &resource_tracker_; |
| 76 } | 76 } |
| 77 virtual PP_Module GetModuleForInstance(PP_Instance instance) OVERRIDE { |
| 78 return 0; |
| 79 } |
| 77 | 80 |
| 78 ResourceTracker& resource_tracker() { return resource_tracker_; } | 81 ResourceTracker& resource_tracker() { return resource_tracker_; } |
| 79 | 82 |
| 80 private: | 83 private: |
| 81 ResourceTracker resource_tracker_; | 84 ResourceTracker resource_tracker_; |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 // Test that LastPluginRefWasDeleted is called when the last plugin ref was | 87 // Test that LastPluginRefWasDeleted is called when the last plugin ref was |
| 85 // deleted but the object lives on. | 88 // deleted but the object lives on. |
| 86 TEST_F(ResourceTrackerTest, LastPluginRef) { | 89 TEST_F(ResourceTrackerTest, LastPluginRef) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 EXPECT_EQ(1, mock_resource_alive_count); | 142 EXPECT_EQ(1, mock_resource_alive_count); |
| 140 EXPECT_EQ(1, last_plugin_ref_was_deleted_count); | 143 EXPECT_EQ(1, last_plugin_ref_was_deleted_count); |
| 141 EXPECT_EQ(1, instance_was_deleted_count); | 144 EXPECT_EQ(1, instance_was_deleted_count); |
| 142 EXPECT_EQ(0, resource->pp_instance()); | 145 EXPECT_EQ(0, resource->pp_instance()); |
| 143 | 146 |
| 144 resource = NULL; | 147 resource = NULL; |
| 145 EXPECT_EQ(0, mock_resource_alive_count); | 148 EXPECT_EQ(0, mock_resource_alive_count); |
| 146 } | 149 } |
| 147 | 150 |
| 148 } // namespace ppapi | 151 } // namespace ppapi |
| OLD | NEW |