Chromium Code Reviews| Index: pkg/intl/test/start_web_server.dart |
| =================================================================== |
| --- pkg/intl/test/start_web_server.dart (revision 0) |
| +++ pkg/intl/test/start_web_server.dart (revision 0) |
| @@ -0,0 +1,24 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +/** |
| + * This file starts a trivial HTTP server to serve locale data files. We start |
| + * it as a separate process, then terminate so that the test can continue to |
| + * run. See web_server.dart for more information. |
| + */ |
| + |
| +#import("dart:io"); |
| +#import("dart:isolate"); |
| + |
| +main() { |
| + // TODO(alanknight): This uses nohup and & to stop the child process from |
| + // stopping when we exit. This won't work on Windows. |
| + var p = Process.start( |
| + "nohup", |
| + [new Options().executable, "pkg/intl/test/web_server.dart", "&"]); |
| + p.onExit = (p) => print("Exited abnormally with exit code: $p"); |
| + // Give the other process a moment to fully start, and give us a meaningful |
| + // exit code if there's an abnormal exit, before we finish. |
| + new Timer(1000, (t) => exit(0)); |
|
Emily Fortuna
2012/09/20 23:07:19
Perhaps if we find ourselves doing more of these s
Alan Knight
2012/09/20 23:29:59
Yes. This is pretty ugly. The delay isn't necessar
Mads Ager (google)
2012/10/01 14:28:08
You actually have the hooks to wait for the proces
|
| +} |