Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: test/cctest/test-weakmaps.cc

Issue 1949393006: Remove deprecated uses of WeakCallbackData from tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/heap/test-mark-compact.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « test/cctest/heap/test-mark-compact.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698