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

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

Issue 2760293002: [dart:io] Adds a finalizer to _NativeSocket to avoid socket leaks (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/bin/socket_win.cc ('k') | tests/standalone/io/socket_finalizer_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:async_helper/async_helper.dart'; 8 import 'package:async_helper/async_helper.dart';
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 socket2.first.then((socket) async { 103 socket2.first.then((socket) async {
104 await socket.drain(); 104 await socket.drain();
105 await socket.close(); 105 await socket.close();
106 asyncEnd(); 106 asyncEnd();
107 }); 107 });
108 108
109 Socket client = await Socket.connect(host, socket2.port); 109 Socket client = await Socket.connect(host, socket2.port);
110 await client.close(); 110 await client.close();
111 await client.drain(); 111 await client.drain();
112 112
113 // Close the second server socket.
114 await socket2.close();
113 asyncEnd(); 115 asyncEnd();
114 } 116 }
115 117
116 main() async { 118 main() async {
117 asyncStart(); 119 asyncStart();
118 120
119 await retry(() async { 121 await retry(() async {
120 await testBindDifferentAddresses(InternetAddress.ANY_IP_V6, 122 await testBindDifferentAddresses(InternetAddress.ANY_IP_V6,
121 InternetAddress.ANY_IP_V4, 123 InternetAddress.ANY_IP_V4,
122 true, 124 true,
(...skipping 13 matching lines...) Expand all
136 negTestBindSharedMismatch(host, false); 138 negTestBindSharedMismatch(host, false);
137 negTestBindSharedMismatch(host, true); 139 negTestBindSharedMismatch(host, true);
138 140
139 negTestBindV6OnlyMismatch(host, true); 141 negTestBindV6OnlyMismatch(host, true);
140 negTestBindV6OnlyMismatch(host, false); 142 negTestBindV6OnlyMismatch(host, false);
141 143
142 testListenCloseListenClose(host); 144 testListenCloseListenClose(host);
143 } 145 }
144 asyncEnd(); 146 asyncEnd();
145 } 147 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | tests/standalone/io/socket_finalizer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698