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

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

Issue 7082012: Heap profiler: fetch document.URL of global objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Style fix Created 9 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
« src/profile-generator.cc ('K') | « src/profile-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 d68692116bff9590396b41095ce5c0544c31f01e..c8417587ac9180b0587209a16cc9d772d875e5ce 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -416,8 +416,8 @@ static const v8::HeapGraphNode* GetGlobalObject(
CHECK_EQ(2, snapshot->GetRoot()->GetChildrenCount());
const v8::HeapGraphNode* global_obj =
snapshot->GetRoot()->GetChild(0)->GetToNode();
- CHECK_EQ("Object", const_cast<i::HeapEntry*>(
- reinterpret_cast<const i::HeapEntry*>(global_obj))->name());
+ CHECK_EQ(0, strncmp("Object", const_cast<i::HeapEntry*>(
+ reinterpret_cast<const i::HeapEntry*>(global_obj))->name(), 6));
return global_obj;
}
@@ -1322,4 +1322,20 @@ TEST(DeleteHeapSnapshot) {
CHECK_EQ(NULL, v8::HeapProfiler::FindSnapshot(uid3));
}
+
+TEST(DocumentURL) {
Vitaly Repeshko 2011/05/29 23:01:34 Please add a test where "document" and/or "URL" th
mnaganov (inactive) 2011/05/30 14:20:42 Done.
+ v8::HandleScope scope;
+ LocalContext env;
+
+ CompileRun("document = { URL:\"abcdefgh\" };");
+
+ const v8::HeapSnapshot* snapshot =
+ v8::HeapProfiler::TakeSnapshot(v8::String::New("document"));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ CHECK_NE(NULL, global);
+ CHECK_EQ("Object / abcdefgh",
+ const_cast<i::HeapEntry*>(
+ reinterpret_cast<const i::HeapEntry*>(global))->name());
+}
+
#endif // ENABLE_LOGGING_AND_PROFILING
« src/profile-generator.cc ('K') | « src/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698