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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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
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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart";
11 import 'dart:io'; 10 import 'dart:io';
12 11
13 void main() { 12 void main() {
14 HttpServer.bind().then((server) { 13 HttpServer.bind().then((server) {
15 server.listen((request) { 14 server.listen((request) {
16 request.response 15 request.response
17 ..writeln("first line") 16 ..writeln("first line")
18 ..write("") 17 ..write("")
19 ..writeln("second line") 18 ..writeln("second line")
20 ..close(); 19 ..close();
21 }); 20 });
22 21
23 HttpClient client = new HttpClient(); 22 HttpClient client = new HttpClient();
24 client.get("127.0.0.1", server.port, "/") 23 client.get("127.0.0.1", server.port, "/")
25 .then((HttpClientRequest request) { 24 .then((HttpClientRequest request) {
26 return request.close(); 25 return request.close();
27 }) 26 })
28 .then((HttpClientResponse response) { 27 .then((HttpClientResponse response) {
29 List<int> body = new List(); 28 List<int> body = new List();
30 response.listen(body.addAll, 29 response.listen(body.addAll,
31 onDone: () { 30 onDone: () {
32 Expect.equals("first line\nsecond line\n", 31 Expect.equals("first line\nsecond line\n",
33 new String.fromCharCodes(body)); 32 new String.fromCharCodes(body));
34 server.close(); 33 server.close();
35 }); 34 });
36 }); 35 });
37 }); 36 });
38 } 37 }
OLDNEW
« no previous file with comments | « tests/standalone/io/regress_7679_test.dart ('k') | tests/standalone/io/secure_client_raw_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698