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

Side by Side Diff: tests/standalone/io/regress-1925.dart

Issue 11744017: Reapply change to enable a couple of tests that were not run because they were named incorrectly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix http_headers_state_test Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/http_headers_state_test.dart ('k') | tests/standalone/io/regress-6521.dart » ('j') | 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) 2012, 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 // Regression test for http://code.google.com/p/dart/issues/detail?id=1925.
6 //
7 // VMOptions=
8 // VMOptions=--short_socket_read
9 // VMOptions=--short_socket_write
10 // VMOptions=--short_socket_read --short_socket_write
11 library ServerTest;
12
13 import "dart:io";
14 import "dart:isolate";
15 part "testing_server.dart";
16
17 class Regress1925TestServer extends TestingServer {
18
19 void onConnection(Socket socket) {
20 socket.onError = (e) => Expect.fail("Server socket error $e");
21 socket.inputStream.onClosed = () => socket.outputStream.close();
22 socket.inputStream.onData = () {
23 var buffer = new List(1);
24 var read = socket.inputStream.readInto(buffer);
25 Expect.equals(1, read);
26 socket.outputStream.writeFrom(buffer, 0, read);
27 };
28 }
29
30 int _connections = 0;
31 }
32
33
34 class Regress1925Test extends TestingServerTest {
35 Regress1925Test.start() : super.start(new Regress1925TestServer());
36
37 void run() {
38
39 var count = 0;
40 var buffer = new List(5);
41 Socket socket = new Socket(TestingServer.HOST, _port);
42 socket.onConnect = () {
43 socket.outputStream.write("12345".charCodes);
44 socket.outputStream.close();
45 socket.inputStream.onData = () {
46 count += socket.inputStream.readInto(buffer, count);
47 };
48 socket.inputStream.onClosed = () {
49 Expect.equals(5, count);
50 shutdown();
51 };
52 socket.inputStream.onError = (e) => Expect.fail("Socket error $e");
53 };
54 }
55 }
56
57 main() {
58 Regress1925Test test = new Regress1925Test.start();
59 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_headers_state_test.dart ('k') | tests/standalone/io/regress-6521.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698