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

Unified Diff: tests/standalone/debugger/debug_lib.dart

Issue 12086080: Fix debugger test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/debugger/debug_lib.dart
diff --git a/tests/standalone/debugger/debug_lib.dart b/tests/standalone/debugger/debug_lib.dart
index 82a115bed1e643428412c7d84db4ccbd6276937e..6a38ca4172597591b228ec26b501129ddaa60571 100644
--- a/tests/standalone/debugger/debug_lib.dart
+++ b/tests/standalone/debugger/debug_lib.dart
@@ -8,7 +8,7 @@ library DartDebugger;
import "dart:io";
import "dart:utf";
-import "dart:json";
+import "dart:json" as JSON;
// TODO(hausner): need to select a different port number for each
// test that runs in parallel.
@@ -430,7 +430,7 @@ class Debugger {
if (errorsDetected) {
error("Error while handling script entry ${script.currentIndex}");
error("Message received from debug target: $msg");
- close();
+ close(killDebugee: true);
Tom Ball 2013/01/31 14:59:26 Spelling: should be "debuggee", to match "debugger
return;
}
if (shutdownEventSeen) {
@@ -471,27 +471,29 @@ class Debugger {
handleMessages();
} catch(e, trace) {
print("Unexpected exception:\n$e\n$trace");
- close();
+ close(killDebugee: true);
}
};
from.onClosed = () {
print("Connection closed by debug target");
- close();
+ close(killDebugee: true);
};
from.onError = (e) {
print("Error '$e' detected in input stream from debug target");
- close();
+ close(killDebugee: true);
};
}
- void close() {
+ void close({killDebugee: false}) {
if (errorsDetected) {
for (int i = 0; i < errors.length; i++) print(errors[i]);
}
to.close();
socket.close();
- targetProcess.kill();
- print("Target process killed");
+ if (killDebugee) {
+ targetProcess.kill();
+ print("Target process killed");
+ }
Expect.isTrue(!errorsDetected);
stdin.close();
stdout.close();
@@ -519,11 +521,12 @@ bool RunScript(List script) {
process.stdout.onData = process.stdout.read;
process.stderr.onData = process.stderr.read;
process.onExit = (int exitCode) {
+ Expect.equals(0, exitCode);
print("Debug target process exited with exit code $exitCode");
};
var debugger = new Debugger(process, debugPort);
- stdin.onClosed = () => debugger.close();
- stdin.onError = (error) => debugger.close();
+ stdin.onClosed = () => debugger.close(killDebugee: true);
+ stdin.onError = (error) => debugger.close(killDebugee: true);
debugger.runScript(script);
});
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698