Index: test/inspector/inspector-test.cc |
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc |
index f3badacacc23adb9db14d739399730d1cd149a21..0368f85f1e6804a007c1f771dfa0ff7fba1cbd4e 100644 |
--- a/test/inspector/inspector-test.cc |
+++ b/test/inspector/inspector-test.cc |
@@ -439,6 +439,7 @@ class InspectorExtension : public v8::Extension { |
"native function attachInspector();" |
"native function detachInspector();" |
"native function setMaxAsyncTaskStacks();" |
+ "native function dumpAsyncTaskStacksStateForTest();" |
"native function breakProgram();" |
"native function createObjectWithStrictCheck();" |
"native function callWithScheduledBreak();" |
@@ -467,6 +468,14 @@ class InspectorExtension : public v8::Extension { |
return v8::FunctionTemplate::New( |
isolate, InspectorExtension::SetMaxAsyncTaskStacks); |
} else if (name->Equals(context, |
+ v8::String::NewFromUtf8( |
+ isolate, "dumpAsyncTaskStacksStateForTest", |
+ v8::NewStringType::kNormal) |
+ .ToLocalChecked()) |
+ .FromJust()) { |
+ return v8::FunctionTemplate::New( |
+ isolate, InspectorExtension::DumpAsyncTaskStacksStateForTest); |
+ } else if (name->Equals(context, |
v8::String::NewFromUtf8(isolate, "breakProgram", |
v8::NewStringType::kNormal) |
.ToLocalChecked()) |
@@ -538,6 +547,19 @@ class InspectorExtension : public v8::Extension { |
inspector, args[0].As<v8::Int32>()->Value()); |
} |
+ static void DumpAsyncTaskStacksStateForTest( |
+ const v8::FunctionCallbackInfo<v8::Value>& args) { |
+ if (args.Length() != 0) { |
+ fprintf(stderr, "Internal error: dumpAsyncTaskStacksStateForTest()."); |
+ Exit(); |
+ } |
+ v8_inspector::V8Inspector* inspector = |
+ InspectorClientImpl::InspectorFromContext( |
+ args.GetIsolate()->GetCurrentContext()); |
+ CHECK(inspector); |
+ v8_inspector::DumpAsyncTaskStacksStateForTest(inspector); |
+ } |
+ |
static void BreakProgram(const v8::FunctionCallbackInfo<v8::Value>& args) { |
if (args.Length() != 2 || !args[0]->IsString() || !args[1]->IsString()) { |
fprintf(stderr, "Internal error: breakProgram('reason', 'details')."); |