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

Side by Side Diff: utils/tests/testrunner/http_client_tests/http_client_test.dart

Issue 16019002: Merge the dart:uri library into dart:core and update the Uri class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final cleanup Created 7 years, 6 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 | « utils/testrunner/run_pipeline.dart ('k') | no next file » | 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 library testrunner_test; 5 library testrunner_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:uri';
10 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
11 10
12 main() { 11 main() {
13 var get = (String what, int code, String text) { 12 var get = (String what, int code, String text) {
14 var c = new Completer(); 13 var c = new Completer();
15 HttpClient client = new HttpClient(); 14 HttpClient client = new HttpClient();
16 client.getUrl(Uri.parse("http://127.0.0.1:3456/$what")) 15 client.getUrl(Uri.parse("http://127.0.0.1:3456/$what"))
17 .then((HttpClientRequest request) { 16 .then((HttpClientRequest request) {
18 // Prepare the request then call close on it to send it. 17 // Prepare the request then call close on it to send it.
19 return request.close(); 18 return request.close();
(...skipping 13 matching lines...) Expand all
33 return c.future; 32 return c.future;
34 }; 33 };
35 test('test1', () { 34 test('test1', () {
36 return get('test.txt', 200, "Hello world!\n"); 35 return get('test.txt', 200, "Hello world!\n");
37 }); 36 });
38 test('test2', () { 37 test('test2', () {
39 return get('fail.txt', 404, ""); 38 return get('fail.txt', 404, "");
40 }); 39 });
41 } 40 }
42 41
OLDNEW
« no previous file with comments | « utils/testrunner/run_pipeline.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698