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

Side by Side Diff: test/inspector/inspector-test.cc

Issue 2842903002: [inspector] improved V8Debugger::breakProgram method (Closed)
Patch Set: rebased Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « test/inspector/inspector-impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if !defined(_WIN32) && !defined(_WIN64) 5 #if !defined(_WIN32) && !defined(_WIN64)
6 #include <unistd.h> // NOLINT 6 #include <unistd.h> // NOLINT
7 #endif // !defined(_WIN32) && !defined(_WIN64) 7 #endif // !defined(_WIN32) && !defined(_WIN64)
8 8
9 #include <locale.h> 9 #include <locale.h>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 v8::FunctionTemplate::New( 77 v8::FunctionTemplate::New(
78 isolate, &UtilsExtension::SetMemoryInfoForTest)); 78 isolate, &UtilsExtension::SetMemoryInfoForTest));
79 utils->Set(ToV8String(isolate, "schedulePauseOnNextStatement"), 79 utils->Set(ToV8String(isolate, "schedulePauseOnNextStatement"),
80 v8::FunctionTemplate::New( 80 v8::FunctionTemplate::New(
81 isolate, &UtilsExtension::SchedulePauseOnNextStatement)); 81 isolate, &UtilsExtension::SchedulePauseOnNextStatement));
82 utils->Set(ToV8String(isolate, "cancelPauseOnNextStatement"), 82 utils->Set(ToV8String(isolate, "cancelPauseOnNextStatement"),
83 v8::FunctionTemplate::New( 83 v8::FunctionTemplate::New(
84 isolate, &UtilsExtension::CancelPauseOnNextStatement)); 84 isolate, &UtilsExtension::CancelPauseOnNextStatement));
85 utils->Set(ToV8String(isolate, "reconnect"), 85 utils->Set(ToV8String(isolate, "reconnect"),
86 v8::FunctionTemplate::New(isolate, &UtilsExtension::Reconnect)); 86 v8::FunctionTemplate::New(isolate, &UtilsExtension::Reconnect));
87 utils->Set(ToV8String(isolate, "disconnect"),
88 v8::FunctionTemplate::New(isolate, &UtilsExtension::Disconnect));
87 utils->Set(ToV8String(isolate, "setLogConsoleApiMessageCalls"), 89 utils->Set(ToV8String(isolate, "setLogConsoleApiMessageCalls"),
88 v8::FunctionTemplate::New( 90 v8::FunctionTemplate::New(
89 isolate, &UtilsExtension::SetLogConsoleApiMessageCalls)); 91 isolate, &UtilsExtension::SetLogConsoleApiMessageCalls));
90 utils->Set(ToV8String(isolate, "createContextGroup"), 92 utils->Set(ToV8String(isolate, "createContextGroup"),
91 v8::FunctionTemplate::New(isolate, 93 v8::FunctionTemplate::New(isolate,
92 &UtilsExtension::CreateContextGroup)); 94 &UtilsExtension::CreateContextGroup));
93 global->Set(ToV8String(isolate, "utils"), utils); 95 global->Set(ToV8String(isolate, "utils"), utils);
94 } 96 }
95 97
96 static void set_backend_task_runner(TaskRunner* runner) { 98 static void set_backend_task_runner(TaskRunner* runner) {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 static void Reconnect(const v8::FunctionCallbackInfo<v8::Value>& args) { 259 static void Reconnect(const v8::FunctionCallbackInfo<v8::Value>& args) {
258 if (args.Length() != 0) { 260 if (args.Length() != 0) {
259 fprintf(stderr, "Internal error: reconnect()."); 261 fprintf(stderr, "Internal error: reconnect().");
260 Exit(); 262 Exit();
261 } 263 }
262 v8::base::Semaphore ready_semaphore(0); 264 v8::base::Semaphore ready_semaphore(0);
263 inspector_client_->scheduleReconnect(&ready_semaphore); 265 inspector_client_->scheduleReconnect(&ready_semaphore);
264 ready_semaphore.Wait(); 266 ready_semaphore.Wait();
265 } 267 }
266 268
269 static void Disconnect(const v8::FunctionCallbackInfo<v8::Value>& args) {
270 if (args.Length() != 0) {
271 fprintf(stderr, "Internal error: disconnect().");
272 Exit();
273 }
274 v8::base::Semaphore ready_semaphore(0);
275 inspector_client_->scheduleDisconnect(&ready_semaphore);
276 ready_semaphore.Wait();
277 }
278
267 static void SetLogConsoleApiMessageCalls( 279 static void SetLogConsoleApiMessageCalls(
268 const v8::FunctionCallbackInfo<v8::Value>& args) { 280 const v8::FunctionCallbackInfo<v8::Value>& args) {
269 if (args.Length() != 1 || !args[0]->IsBoolean()) { 281 if (args.Length() != 1 || !args[0]->IsBoolean()) {
270 fprintf(stderr, "Internal error: setLogConsoleApiMessageCalls(bool)."); 282 fprintf(stderr, "Internal error: setLogConsoleApiMessageCalls(bool).");
271 Exit(); 283 Exit();
272 } 284 }
273 inspector_client_->setLogConsoleApiMessageCalls( 285 inspector_client_->setLogConsoleApiMessageCalls(
274 args[0].As<v8::Boolean>()->Value()); 286 args[0].As<v8::Boolean>()->Value());
275 } 287 }
276 288
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 argv[i]); 638 argv[i]);
627 Exit(); 639 Exit();
628 } 640 }
629 frontend_runner.Append(new ExecuteStringTask(chars)); 641 frontend_runner.Append(new ExecuteStringTask(chars));
630 } 642 }
631 643
632 frontend_runner.Join(); 644 frontend_runner.Join();
633 backend_runner.Join(); 645 backend_runner.Join();
634 return 0; 646 return 0;
635 } 647 }
OLDNEW
« 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