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

Side by Side Diff: test/virtual_host_test.dart

Issue 1432143003: Update the tests to run with Dart 1.13. (Closed) Base URL: git@github.com:dart-lang/http_server.git@master
Patch Set: Created 5 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
« test/utils.dart ('K') | « test/utils.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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import "package:unittest/unittest.dart"; 8 import "package:unittest/unittest.dart";
9 import "package:http_server/http_server.dart"; 9 import "package:http_server/http_server.dart";
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 getStatusCode(server.port, '/', host: 'my.host1.com'), 59 getStatusCode(server.port, '/', host: 'my.host1.com'),
60 getStatusCode(server.port, '/', host: 'my.host2.com'), 60 getStatusCode(server.port, '/', host: 'my.host2.com'),
61 getStatusCode(server.port, '/', host: 'my.host3.com')]) 61 getStatusCode(server.port, '/', host: 'my.host3.com')])
62 .whenComplete(server.close); 62 .whenComplete(server.close);
63 }), completion(equals([HttpStatus.OK, HttpStatus.OK, HttpStatus.OK]))); 63 }), completion(equals([HttpStatus.OK, HttpStatus.OK, HttpStatus.OK])));
64 }); 64 });
65 65
66 test('multiple-source-https', () { 66 test('multiple-source-https', () {
67 expect(Future.wait([ 67 expect(Future.wait([
68 HttpServer.bind('localhost', 0), 68 HttpServer.bind('localhost', 0),
69 HttpServer.bindSecure('localhost', 0, certificateName: CERTIFICATE)]) 69 HttpServer.bindSecure('localhost', 0, serverContext)])
70 .then((servers) { 70 .then((servers) {
71 var virHost = new VirtualHost(); 71 var virHost = new VirtualHost();
72 virHost.addSource(servers[0]); 72 virHost.addSource(servers[0]);
73 virHost.addSource(servers[1]); 73 virHost.addSource(servers[1]);
74 virHost.unhandled.listen((request) { 74 virHost.unhandled.listen((request) {
75 request.response.close(); 75 request.response.close();
76 }); 76 });
77 return Future.wait([ 77 return Future.wait([
78 getStatusCode(servers[0].port, '/', host: 'myhost1.com'), 78 getStatusCode(servers[0].port, '/', host: 'myhost1.com'),
79 getStatusCode( 79 getStatusCode(
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 expect(() => (virHost.addHost('*.host.com')), throwsArgumentError); 172 expect(() => (virHost.addHost('*.host.com')), throwsArgumentError);
173 virHost.addHost('my2.host.com'); 173 virHost.addHost('my2.host.com');
174 virHost.addHost('my3.host.com'); 174 virHost.addHost('my3.host.com');
175 virHost.addHost('*.com'); 175 virHost.addHost('*.com');
176 virHost.addHost('*'); 176 virHost.addHost('*');
177 expect(() => (virHost.addHost('*')), throwsArgumentError); 177 expect(() => (virHost.addHost('*')), throwsArgumentError);
178 }); 178 });
179 }); 179 });
180 } 180 }
181 181
OLDNEW
« test/utils.dart ('K') | « test/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698