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

Unified Diff: test/inspector/inspector-test.cc

Issue 2842903002: [inspector] improved V8Debugger::breakProgram method (Closed)
Patch Set: rebased Created 3 years, 8 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
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698