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

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

Issue 2204953002: Don't close stdio/stderr when shutting down. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add comment. Created 4 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/bin/file_win.cc ('k') | tests/standalone/io/stdio_implicit_close_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/stdio_implicit_close_script.dart
diff --git a/tests/standalone/io/stdio_implicit_close_script.dart b/tests/standalone/io/stdio_implicit_close_script.dart
new file mode 100644
index 0000000000000000000000000000000000000000..4be58a88d3ea26dc2d64d68d25b621aba5537830
--- /dev/null
+++ b/tests/standalone/io/stdio_implicit_close_script.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2015, 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.
+
+import "dart:io";
+
+void main(List<String> arguments) {
+ // Access stdout and stderr so that the system grabs a handle to it. This
+ // initializes some internal structures.
+ if (stdout.hashCode == -1234 && stderr.hashCode == (stderr.hashCode + 1)) {
+ throw "we have other problems.";
+ }
+
+ if (arguments.contains("stdout")) {
+ stdout.close();
+ }
+ if (arguments.contains("stderr")) {
+ stderr.close();
+ }
+}
« no previous file with comments | « runtime/bin/file_win.cc ('k') | tests/standalone/io/stdio_implicit_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698