Chromium Code Reviews| 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 |