| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "content/renderer/pepper/host_globals.h" | 7 #include "content/renderer/pepper/host_globals.h" |
| 8 #include "content/renderer/pepper/host_var_tracker.h" | 8 #include "content/renderer/pepper/host_var_tracker.h" |
| 9 #include "content/renderer/pepper/mock_resource.h" | 9 #include "content/renderer/pepper/mock_resource.h" |
| 10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(PepperTryCatchForTest); | 64 DISALLOW_COPY_AND_ASSIGN(PepperTryCatchForTest); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 } // namespace | 67 } // namespace |
| 68 | 68 |
| 69 class HostVarTrackerTest : public PpapiUnittest { | 69 class HostVarTrackerTest : public PpapiUnittest { |
| 70 public: | 70 public: |
| 71 HostVarTrackerTest() {} | 71 HostVarTrackerTest() {} |
| 72 | 72 |
| 73 virtual void TearDown() override { | 73 void TearDown() override { |
| 74 v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting( | 74 v8::Isolate::GetCurrent()->RequestGarbageCollectionForTesting( |
| 75 v8::Isolate::kFullGarbageCollection); | 75 v8::Isolate::kFullGarbageCollection); |
| 76 EXPECT_EQ(0, g_v8objects_alive); | 76 EXPECT_EQ(0, g_v8objects_alive); |
| 77 PpapiUnittest::TearDown(); | 77 PpapiUnittest::TearDown(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 HostVarTracker& tracker() { return *HostGlobals::Get()->host_var_tracker(); } | 80 HostVarTracker& tracker() { return *HostGlobals::Get()->host_var_tracker(); } |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 TEST_F(HostVarTrackerTest, DeleteObjectVarWithInstance) { | 83 TEST_F(HostVarTrackerTest, DeleteObjectVarWithInstance) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 pp_object1 = ppapi::ScopedPPVar(); | 132 pp_object1 = ppapi::ScopedPPVar(); |
| 133 pp_object2 = ppapi::ScopedPPVar(); | 133 pp_object2 = ppapi::ScopedPPVar(); |
| 134 | 134 |
| 135 // Releasing the resource should free the internal ref, and so making a new | 135 // Releasing the resource should free the internal ref, and so making a new |
| 136 // one now should generate a new ID. | 136 // one now should generate a new ID. |
| 137 ppapi::ScopedPPVar pp_object3 = try_catch.FromV8(v8_object); | 137 ppapi::ScopedPPVar pp_object3 = try_catch.FromV8(v8_object); |
| 138 EXPECT_NE(pp_object1.get().value.as_id, pp_object3.get().value.as_id); | 138 EXPECT_NE(pp_object1.get().value.as_id, pp_object3.get().value.as_id); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace content | 141 } // namespace content |
| OLD | NEW |