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

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

Issue 11365131: Implement VisitHandlesInNewSpaceWithClassIds() (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fixed format Created 7 years, 11 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
« src/global-handles.cc ('K') | « src/global-handles.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index dbde26f1a19ded9a2418b6c35115d90e2501c1ba..74e747dd2ed3df8a0f3cf984081a7b420131a21a 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -16699,6 +16699,32 @@ TEST(WrapperClassId) {
}
+TEST(PersistentHandleInNewSpaceVisitor) {
+ v8::HandleScope scope;
+ LocalContext context;
+ v8::Persistent<v8::Object> object1 =
+ v8::Persistent<v8::Object>::New(v8::Object::New());
+ CHECK_EQ(0, object1.WrapperClassId());
+ object1.SetWrapperClassId(42);
+ CHECK_EQ(42, object1.WrapperClassId());
+
+ HEAP->CollectAllGarbage(i::Heap::kNoGCFlags);
+
+ v8::Persistent<v8::Object> object2 =
+ v8::Persistent<v8::Object>::New(v8::Object::New());
+ CHECK_EQ(0, object2.WrapperClassId());
+ object2.SetWrapperClassId(42);
+ CHECK_EQ(42, object2.WrapperClassId());
+
+ Visitor42 visitor(object2);
+ v8::V8::VisitHandlesForPartialDependence(v8::Isolate::GetCurrent(), &visitor);
+ CHECK_EQ(1, visitor.counter_);
+
+ object1.Dispose();
+ object2.Dispose();
+}
+
+
TEST(RegExp) {
v8::HandleScope scope;
LocalContext context;
« src/global-handles.cc ('K') | « src/global-handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698