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

Unified Diff: runtime/observatory/tests/service/test_helper.dart

Issue 1285643004: Allow stepping when paused at isolate start. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/observatory/tests/service/pause_on_start_then_step_test.dart ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/test_helper.dart
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index 4c492edefe43d0e274ae04b45b210de7eb01a9b1..d640dc504894e993df3e3914a9afc4231cf518ed 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -26,9 +26,12 @@ class _TestLauncher {
Platform.script.toFilePath(),
_TESTEE_MODE_FLAG] {}
- Future<int> launch(bool pause_on_exit) {
+ Future<int> launch(bool pause_on_start, bool pause_on_exit) {
String dartExecutable = Platform.executable;
var fullArgs = [];
+ if (pause_on_start == true) {
+ fullArgs.add('--pause-isolates-on-start');
+ }
if (pause_on_exit == true) {
fullArgs.add('--pause-isolates-on-exit');
}
@@ -49,7 +52,7 @@ class _TestLauncher {
var port = portExp.firstMatch(line).group(1);
portNumber = int.parse(port);
}
- if (line == '') {
+ if (pause_on_start || line == '') {
// Received blank line.
blank = true;
}
@@ -98,20 +101,26 @@ void runIsolateTests(List<String> mainArgs,
List<IsolateTest> tests,
{void testeeBefore(),
void testeeConcurrent(),
- bool pause_on_exit}) {
+ bool pause_on_start: false,
+ bool pause_on_exit: false}) {
+ assert(!pause_on_start || testeeBefore == null);
if (mainArgs.contains(_TESTEE_MODE_FLAG)) {
- if (testeeBefore != null) {
- testeeBefore();
+ if (!pause_on_start) {
+ if (testeeBefore != null) {
+ testeeBefore();
+ }
+ print(''); // Print blank line to signal that we are ready.
}
- print(''); // Print blank line to signal that we are ready.
if (testeeConcurrent != null) {
testeeConcurrent();
}
- // Wait around for the process to be killed.
- stdin.first.then((_) => exit(0));
+ if (!pause_on_exit) {
+ // Wait around for the process to be killed.
+ stdin.first.then((_) => exit(0));
+ }
} else {
var process = new _TestLauncher();
- process.launch(pause_on_exit).then((port) {
+ process.launch(pause_on_start, pause_on_exit).then((port) {
if (mainArgs.contains("--gdb")) {
port = 8181;
}
@@ -140,26 +149,6 @@ void runIsolateTests(List<String> mainArgs,
}
-// Cancel the subscription and complete the completer when finished processing
-// events.
-typedef void ServiceEventHandler(ServiceEvent event,
- StreamSubscription subscription,
- Completer completer);
-
-Future processServiceEvents(VM vm,
- String streamId,
- ServiceEventHandler handler) {
- Completer completer = new Completer();
- vm.getEventStream(streamId).then((stream) {
- var subscription;
- subscription = stream.listen((ServiceEvent event) {
- handler(event, subscription, completer);
- });
- });
- return completer.future;
-}
-
-
Future<Isolate> hasStoppedAtBreakpoint(Isolate isolate) {
// Set up a listener to wait for breakpoint events.
Completer completer = new Completer();
@@ -286,20 +275,25 @@ Future runVMTests(List<String> mainArgs,
List<VMTest> tests,
{Future testeeBefore(),
Future testeeConcurrent(),
- bool pause_on_exit}) async {
+ bool pause_on_start: false,
+ bool pause_on_exit: false}) async {
if (mainArgs.contains(_TESTEE_MODE_FLAG)) {
- if (testeeBefore != null) {
- await testeeBefore();
+ if (!pause_on_start) {
+ if (testeeBefore != null) {
+ await testeeBefore();
+ }
+ print(''); // Print blank line to signal that we are ready.
}
- print(''); // Print blank line to signal that we are ready.
if (testeeConcurrent != null) {
await testeeConcurrent();
}
- // Wait around for the process to be killed.
- stdin.first.then((_) => exit(0));
+ if (!pause_on_exit) {
+ // Wait around for the process to be killed.
+ stdin.first.then((_) => exit(0));
+ }
} else {
var process = new _TestLauncher();
- process.launch(pause_on_exit).then((port) async {
+ process.launch(pause_on_start, pause_on_exit).then((port) async {
if (mainArgs.contains("--gdb")) {
port = 8181;
}
« no previous file with comments | « runtime/observatory/tests/service/pause_on_start_then_step_test.dart ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698