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

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

Issue 143263015: Add global_context field to GlobalObject in heap profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added a test. Created 6 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
« no previous file with comments | « src/heap-snapshot-generator.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-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 026dfbc7da2e92124ad5164f7410206f9d4a8508..efb80453e02117724dd5a33b5c07d1fdb6eed7b9 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -1537,6 +1537,30 @@ TEST(GlobalObjectName) {
}
+TEST(GlobalObjectFields) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
+ CompileRun("obj = {};");
+ const v8::HeapSnapshot* snapshot =
+ heap_profiler->TakeHeapSnapshot(v8_str("snapshot"));
+ CHECK(ValidateSnapshot(snapshot));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ const v8::HeapGraphNode* builtins =
+ GetProperty(global, v8::HeapGraphEdge::kInternal, "builtins");
+ CHECK_NE(NULL, builtins);
+ const v8::HeapGraphNode* native_context =
+ GetProperty(global, v8::HeapGraphEdge::kInternal, "native_context");
+ CHECK_NE(NULL, native_context);
+ const v8::HeapGraphNode* global_context =
+ GetProperty(global, v8::HeapGraphEdge::kInternal, "global_context");
+ CHECK_NE(NULL, global_context);
+ const v8::HeapGraphNode* global_receiver =
+ GetProperty(global, v8::HeapGraphEdge::kInternal, "global_receiver");
+ CHECK_NE(NULL, global_receiver);
+}
+
+
TEST(NoHandleLeaks) {
LocalContext env;
v8::HandleScope scope(env->GetIsolate());
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698