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

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

Issue 1435273002: Fix name shown by devtools for subclasses. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 9bdd3b81e66e6778349729291fcf5a0366db4687..d4e4cfb19c6a54de4a4a1d40d35ad0c2ad02a3d5 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -1818,11 +1818,11 @@ TEST(GetConstructorName) {
"var Constructor2 = function() {};\n"
"var obj2 = new Constructor2();\n"
"var obj3 = {};\n"
- "obj3.constructor = function Constructor3() {};\n"
+ "obj3.__proto__ = { constructor: function Constructor3() {} };\n"
"var obj4 = {};\n"
"// Slow properties\n"
"for (var i=0; i<2000; ++i) obj4[\"p\" + i] = i;\n"
- "obj4.constructor = function Constructor4() {};\n"
+ "obj4.__proto__ = { constructor: function Constructor4() {} };\n"
"var obj5 = {};\n"
"var obj6 = {};\n"
"obj6.constructor = 6;");
@@ -1838,16 +1838,12 @@ TEST(GetConstructorName) {
"Constructor2", i::V8HeapExplorer::GetConstructorName(*js_obj2)));
v8::Local<v8::Object> obj3 = js_global->Get(v8_str("obj3")).As<v8::Object>();
i::Handle<i::JSObject> js_obj3 = v8::Utils::OpenHandle(*obj3);
- // TODO(verwaest): Restore to Constructor3 once supported by the
- // heap-snapshot-generator.
- CHECK_EQ(
- 0, StringCmp("Object", i::V8HeapExplorer::GetConstructorName(*js_obj3)));
+ CHECK_EQ(0, StringCmp("Constructor3",
+ i::V8HeapExplorer::GetConstructorName(*js_obj3)));
v8::Local<v8::Object> obj4 = js_global->Get(v8_str("obj4")).As<v8::Object>();
i::Handle<i::JSObject> js_obj4 = v8::Utils::OpenHandle(*obj4);
- // TODO(verwaest): Restore to Constructor4 once supported by the
- // heap-snapshot-generator.
- CHECK_EQ(
- 0, StringCmp("Object", i::V8HeapExplorer::GetConstructorName(*js_obj4)));
+ CHECK_EQ(0, StringCmp("Constructor4",
+ i::V8HeapExplorer::GetConstructorName(*js_obj4)));
v8::Local<v8::Object> obj5 = js_global->Get(v8_str("obj5")).As<v8::Object>();
i::Handle<i::JSObject> js_obj5 = v8::Utils::OpenHandle(*obj5);
CHECK_EQ(0, StringCmp(

Powered by Google App Engine
This is Rietveld 408576698