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

Side by Side Diff: tests/standalone/src/ProcessStdoutTest.dart

Issue 8437090: Change the handling of closing sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by ager@ Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/src/ProcessStderrTest.dart ('k') | tests/standalone/src/SocketCloseTest.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Process test program to test process communication. 5 // Process test program to test process communication.
6 // 6 //
7 // VMOptions= 7 // VMOptions=
8 // VMOptions=--short_socket_read 8 // VMOptions=--short_socket_read
9 // VMOptions=--short_socket_write 9 // VMOptions=--short_socket_write
10 // VMOptions=--short_socket_read --short_socket_write 10 // VMOptions=--short_socket_read --short_socket_write
(...skipping 17 matching lines...) Expand all
28 process.start(); 28 process.start();
29 29
30 int received = 0; 30 int received = 0;
31 31
32 void readData() { 32 void readData() {
33 List<int> buffer = input.read(); 33 List<int> buffer = input.read();
34 for (int i = 0; i < buffer.length; i++) { 34 for (int i = 0; i < buffer.length; i++) {
35 Expect.equals(data[received + i], buffer[i]); 35 Expect.equals(data[received + i], buffer[i]);
36 } 36 }
37 received += buffer.length; 37 received += buffer.length;
38 if (received == BUFFERSIZE) {
39 process.close();
40 }
41 } 38 }
42 39
43 void streamClosed() { 40 void streamClosed() {
44 Expect.equals(BUFFERSIZE, received); 41 Expect.equals(BUFFERSIZE, received);
42 process.close();
45 } 43 }
46 44
47 output.write(data); 45 output.write(data);
48 output.end(); 46 output.close();
49 input.dataHandler = readData; 47 input.dataHandler = readData;
50 input.closeHandler = streamClosed; 48 input.closeHandler = streamClosed;
51 } 49 }
52 50
53 static void testMain() { 51 static void testMain() {
54 testStdout(); 52 testStdout();
55 } 53 }
56 } 54 }
57 55
58 main() { 56 main() {
59 ProcessStdoutTest.testMain(); 57 ProcessStdoutTest.testStdout();
60 } 58 }
OLDNEW
« no previous file with comments | « tests/standalone/src/ProcessStderrTest.dart ('k') | tests/standalone/src/SocketCloseTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698