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

Side by Side Diff: test/http_multi_server_test.dart

Issue 1236403006: Upgrade to the new test package. (Closed) Base URL: git@github.com:dart-lang/http_multi_server@master
Patch Set: Created 5 years, 5 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
« .test_config ('K') | « pubspec.yaml ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 http_multi_server.test; 5 library http_multi_server.test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
11 import 'package:http_multi_server/http_multi_server.dart'; 11 import 'package:http_multi_server/http_multi_server.dart';
12 import 'package:http_multi_server/src/utils.dart'; 12 import 'package:http_multi_server/src/utils.dart';
13 import 'package:unittest/unittest.dart'; 13 import 'package:test/test.dart';
14 14
15 void main() { 15 void main() {
16 group("with multiple HttpServers", () { 16 group("with multiple HttpServers", () {
17 var multiServer; 17 var multiServer;
18 var subServer1; 18 var subServer1;
19 var subServer2; 19 var subServer2;
20 var subServer3; 20 var subServer3;
21 setUp(() { 21 setUp(() {
22 return Future.wait([ 22 return Future.wait([
23 HttpServer.bind("127.0.0.1", 0).then((server) => subServer1 = server), 23 HttpServer.bind("127.0.0.1", 0).then((server) => subServer1 = server),
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 /// Makes a GET request to the root of [server] and returns the response. 163 /// Makes a GET request to the root of [server] and returns the response.
164 Future<http.Response> _get(HttpServer server) => http.get(_urlFor(server)); 164 Future<http.Response> _get(HttpServer server) => http.get(_urlFor(server));
165 165
166 /// Makes a GET request to the root of [server] and returns the response body. 166 /// Makes a GET request to the root of [server] and returns the response body.
167 Future<String> _read(HttpServer server) => http.read(_urlFor(server)); 167 Future<String> _read(HttpServer server) => http.read(_urlFor(server));
168 168
169 /// Returns the URL for the root of [server]. 169 /// Returns the URL for the root of [server].
170 String _urlFor(HttpServer server) => 170 String _urlFor(HttpServer server) =>
171 "http://${server.address.host}:${server.port}/"; 171 "http://${server.address.host}:${server.port}/";
OLDNEW
« .test_config ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698