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

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 171683013: Add object hidden properties to heap snapshot (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index c04ed9de13bee42711db470fee3ea1fbcb5b0d3a..7758fdc066cb51c597fcdd544844f1653be4d3ed 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -2477,3 +2477,29 @@ TEST(BoxObject) {
GetProperty(box_node, v8::HeapGraphEdge::kInternal, "value");
CHECK_NE(NULL, box_value);
}
+
+
+TEST(JSObjectHiddenProperty) {
+ LocalContext env;
+ v8::Isolate* isolate = env->GetIsolate();
+ v8::HandleScope handle_scope(isolate);
+ v8::HeapProfiler* heap_profiler = isolate->GetHeapProfiler();
+
+ v8::Local<v8::Object> an_object = v8::Object::New(isolate);
+ env->Global()->Set(v8_str("an_object"), an_object);
+ CHECK(an_object->SetHiddenValue(v8_str("hidden_key"),
+ v8_str("hidden_value")));
+
+ const v8::HeapSnapshot* snapshot =
+ heap_profiler->TakeHeapSnapshot(v8_str("snapshot"));
+ CHECK(ValidateSnapshot(snapshot));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ const v8::HeapGraphNode* object_node =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "an_object");
+ CHECK_NE(NULL, object_node);
+ const v8::HeapGraphNode* hidden_node =
+ GetProperty(object_node, v8::HeapGraphEdge::kProperty, "hidden_key");
+ CHECK_NE(NULL, hidden_node);
+ CHECK_EQ(v8::String::NewFromUtf8(env->GetIsolate(), "hidden_value"),
+ hidden_node->GetName());
+}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698