Index: test/inspector/inspector-test.cc |
diff --git a/test/inspector/inspector-test.cc b/test/inspector/inspector-test.cc |
index 0d19b8d82d2f14a78fa61a31d0c4eb1bc0eb964e..2acac450bff1b8ba572fe312bc4e23b72d0aa196 100644 |
--- a/test/inspector/inspector-test.cc |
+++ b/test/inspector/inspector-test.cc |
@@ -84,6 +84,8 @@ class UtilsExtension : public TaskRunner::SetupGlobalTask { |
isolate, &UtilsExtension::CancelPauseOnNextStatement)); |
utils->Set(ToV8String(isolate, "reconnect"), |
v8::FunctionTemplate::New(isolate, &UtilsExtension::Reconnect)); |
+ utils->Set(ToV8String(isolate, "disconnect"), |
+ v8::FunctionTemplate::New(isolate, &UtilsExtension::Disconnect)); |
utils->Set(ToV8String(isolate, "setLogConsoleApiMessageCalls"), |
v8::FunctionTemplate::New( |
isolate, &UtilsExtension::SetLogConsoleApiMessageCalls)); |
@@ -264,6 +266,16 @@ class UtilsExtension : public TaskRunner::SetupGlobalTask { |
ready_semaphore.Wait(); |
} |
+ static void Disconnect(const v8::FunctionCallbackInfo<v8::Value>& args) { |
+ if (args.Length() != 0) { |
+ fprintf(stderr, "Internal error: disconnect()."); |
+ Exit(); |
+ } |
+ v8::base::Semaphore ready_semaphore(0); |
+ inspector_client_->scheduleDisconnect(&ready_semaphore); |
+ ready_semaphore.Wait(); |
+ } |
+ |
static void SetLogConsoleApiMessageCalls( |
const v8::FunctionCallbackInfo<v8::Value>& args) { |
if (args.Length() != 1 || !args[0]->IsBoolean()) { |