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

Unified Diff: tests/standalone/io/signal_test_script.dart

Issue 285023002: Fix listening for multiple signals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/process_win.cc ('k') | tests/standalone/io/signals_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/signal_test_script.dart
diff --git a/tests/standalone/io/signal_test_script.dart b/tests/standalone/io/signal_test_script.dart
index 02b2c25f6d933ceaebe3c417cfecf8968493f622..07f4c0341df59e425fc5e5c394cf341187e41a54 100644
--- a/tests/standalone/io/signal_test_script.dart
+++ b/tests/standalone/io/signal_test_script.dart
@@ -6,22 +6,24 @@ import "dart:io";
import "dart:async";
void main(args) {
- var signal;
// This process should die if it never receives a signal.
var timeout = new Timer(new Duration(seconds: 25), () => exit(1));
- switch (args[0]) {
- case 'SIGHUP': signal = ProcessSignal.SIGHUP; break;
- case 'SIGINT': signal = ProcessSignal.SIGINT; break;
- case 'SIGTERM': signal = ProcessSignal.SIGTERM; break;
- case 'SIGUSR1': signal = ProcessSignal.SIGUSR1; break;
- case 'SIGUSR2': signal = ProcessSignal.SIGUSR2; break;
- case 'SIGWINCH': signal = ProcessSignal.SIGWINCH; break;
+ for (var arg in args) {
+ var signal;
+ switch (arg) {
+ case 'SIGHUP': signal = ProcessSignal.SIGHUP; break;
+ case 'SIGINT': signal = ProcessSignal.SIGINT; break;
+ case 'SIGTERM': signal = ProcessSignal.SIGTERM; break;
+ case 'SIGUSR1': signal = ProcessSignal.SIGUSR1; break;
+ case 'SIGUSR2': signal = ProcessSignal.SIGUSR2; break;
+ case 'SIGWINCH': signal = ProcessSignal.SIGWINCH; break;
+ }
+ signal.watch().first.then((s) {
+ if (signal != s) exit(1);
+ if (signal.toString() != arg) exit(1);
+ print(signal);
+ exit(0);
+ });
}
- signal.watch().first.then((s) {
- if (signal != s) exit(1);
- if (signal.toString() != args[0]) exit(1);
- print('got signal');
- timeout.cancel();
- });
print("ready");
}
« no previous file with comments | « runtime/bin/process_win.cc ('k') | tests/standalone/io/signals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698