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

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

Issue 131173002: Fix http_requested_uri_test for Win/Mac. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | 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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import "dart:async"; 7 import "dart:async";
8 import "dart:io"; 8 import "dart:io";
9 9
10 const PATH = '/path?a=b#c'; 10 const PATH = '/path?a=b#c';
11 11
12 void test(String expected, Map headers) { 12 void test(String expected, Map headers) {
13 asyncStart(); 13 asyncStart();
14 HttpServer.bind("127.0.0.1", 0).then((server) { 14 HttpServer.bind("localhost", 0).then((server) {
Søren Gjesse 2014/01/09 08:53:57 Wheren't the use of localhost the source of sporad
Søren Gjesse 2014/01/09 09:00:56 Thinking about this again the issue was only there
15 expected = expected.replaceAll('%PORT', server.port.toString()); 15 expected = expected.replaceAll('%PORT', server.port.toString());
16 server.listen((request) { 16 server.listen((request) {
17 Expect.equals("$expected$PATH", 17 Expect.equals("$expected$PATH",
18 request.requestedUri.toString()); 18 request.requestedUri.toString());
19 request.response.close(); 19 request.response.close();
20 }); 20 });
21 HttpClient client = new HttpClient(); 21 HttpClient client = new HttpClient();
22 client.get("localhost", server.port, PATH) 22 client.get("localhost", server.port, PATH)
23 .then((request) { 23 .then((request) {
24 for (var v in headers.keys) { 24 for (var v in headers.keys) {
(...skipping 12 matching lines...) Expand all
37 }); 37 });
38 }); 38 });
39 } 39 }
40 40
41 41
42 void main() { 42 void main() {
43 test('http://localhost:%PORT', {}); 43 test('http://localhost:%PORT', {});
44 test('https://localhost:%PORT', {'x-forwarded-proto': 'https'}); 44 test('https://localhost:%PORT', {'x-forwarded-proto': 'https'});
45 test('ws://localhost:%PORT', {'x-forwarded-proto': 'ws'}); 45 test('ws://localhost:%PORT', {'x-forwarded-proto': 'ws'});
46 test('http://my-host:321', {'x-forwarded-host': 'my-host:321'}); 46 test('http://my-host:321', {'x-forwarded-host': 'my-host:321'});
47 test('http://127.0.0.1:%PORT', {'host': null}); 47 test('http://localhost:%PORT', {'host': null});
48 } 48 }
49 49
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698