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

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

Issue 96203006: Fix socket to report write errors async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/socket_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/raw_socket_test.dart
diff --git a/tests/standalone/io/raw_socket_test.dart b/tests/standalone/io/raw_socket_test.dart
index a469084cf7ce10798a6284138c80aa086499d215..ddf5611194e8512d42cc2ee025de68ca4e247b92 100644
--- a/tests/standalone/io/raw_socket_test.dart
+++ b/tests/standalone/io/raw_socket_test.dart
@@ -408,15 +408,21 @@ void testSocketZoneError() {
RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
Expect.notEquals(Zone.ROOT, Zone.current);
server.listen((socket) {
+ Expect.notEquals(Zone.ROOT, Zone.current);
+ var timer;
+ void write() {
+ socket.write(const [0]);
+ timer = new Timer(const Duration(milliseconds: 5), write);
+ }
+ write();
socket.listen((_) {
}, onError: (error) {
+ timer.cancel();
Expect.notEquals(Zone.ROOT, Zone.current);
socket.close();
server.close();
throw error;
});
- Expect.notEquals(Zone.ROOT, Zone.current);
- socket.write(const [0]);
});
RawSocket.connect("127.0.0.1", server.port).then((socket) {
socket.close();
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698