Index: test/cctest/test-weakmaps.cc |
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc |
index 781ad1f69f8877fba50c040bc20fd464d1f8bc4b..829f3202125c6f82e50a4e98c69993b7d41d9389 100644 |
--- a/test/cctest/test-weakmaps.cc |
+++ b/test/cctest/test-weakmaps.cc |
@@ -52,8 +52,7 @@ static Handle<JSWeakMap> AllocateJSWeakMap(Isolate* isolate) { |
} |
static int NumberOfWeakCalls = 0; |
-static void WeakPointerCallback( |
- const v8::WeakCallbackData<v8::Value, void>& data) { |
+static void WeakPointerCallback(const v8::WeakCallbackInfo<void>& data) { |
std::pair<v8::Persistent<v8::Value>*, int>* p = |
reinterpret_cast<std::pair<v8::Persistent<v8::Value>*, int>*>( |
data.GetParameter()); |
@@ -107,20 +106,12 @@ TEST(Weakness) { |
{ |
HandleScope scope(isolate); |
std::pair<Handle<Object>*, int> handle_and_id(&key, 1234); |
- GlobalHandles::MakeWeak(key.location(), |
- reinterpret_cast<void*>(&handle_and_id), |
- &WeakPointerCallback); |
+ GlobalHandles::MakeWeak( |
+ key.location(), reinterpret_cast<void*>(&handle_and_id), |
+ &WeakPointerCallback, v8::WeakCallbackType::kParameter); |
} |
CHECK(global_handles->IsWeak(key.location())); |
- // Force a full GC. |
- // Perform two consecutive GCs because the first one will only clear |
- // weak references whereas the second one will also clear weak maps. |
- heap->CollectAllGarbage(false); |
- CHECK_EQ(1, NumberOfWeakCalls); |
- CHECK_EQ(2, ObjectHashTable::cast(weakmap->table())->NumberOfElements()); |
- CHECK_EQ( |
- 0, ObjectHashTable::cast(weakmap->table())->NumberOfDeletedElements()); |
heap->CollectAllGarbage(false); |
CHECK_EQ(1, NumberOfWeakCalls); |
CHECK_EQ(0, ObjectHashTable::cast(weakmap->table())->NumberOfElements()); |