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

Side by Side Diff: tests/standalone/io/stdio_socket_finalizer_test.dart

Issue 2791423002: [dart:io] Don't close stdin with a socket finalizer (Closed)
Patch Set: Address comments Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « runtime/platform/globals.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 //
5 // This test checks that stdin is *not* closed when an Isolate leaks it.
6
7 import 'dart:async';
8 import 'dart:io';
9 import 'dart:isolate';
10
11 import "package:async_helper/async_helper.dart";
12 import "package:expect/expect.dart";
13
14 void ConnectorIsolate(SendPort sendPort) {
15 stdin;
16 sendPort.send(true);
17 }
18
19 main() async {
20 asyncStart();
21 ReceivePort receivePort = new ReceivePort();
22 Isolate isolate = await Isolate.spawn(ConnectorIsolate, receivePort.sendPort);
23 Completer<Null> completer = new Completer<Null>();
24 receivePort.listen((msg) {
25 Expect.isTrue(msg is bool);
26 Expect.isTrue(msg);
27 isolate.kill();
28 completer.complete(null);
29 });
30 await completer.future;
31 stdin.listen((_) {}).cancel();
32 receivePort.close();
33 asyncEnd();
34 }
OLDNEW
« no previous file with comments | « runtime/platform/globals.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698