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

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

Issue 125743002: Add HttpRequest::requestedUri. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Provide fall-back host and port. 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
« sdk/lib/io/http.dart ('K') | « sdk/lib/io/http_impl.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:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 socket.write('some body'); 102 socket.write('some body');
103 socket.close(); 103 socket.close();
104 }); 104 });
105 }); 105 });
106 }, onError: (e) { 106 }, onError: (e) {
107 asyncEnd(); 107 asyncEnd();
108 }); 108 });
109 } 109 }
110 110
111 111
112 void testAbsoluteUri() {
113 asyncStart();
114 HttpServer.bind("127.0.0.1", 0).then((server) {
115 server.listen((request) {
116 Expect.equals("http://localhost:${server.port}/path?a=b#c",
117 request.absoluteUri.toString());
118 request.response.close();
119 });
120 HttpClient client = new HttpClient();
121 client.get("localhost", server.port, "/path?a=b#c")
122 .then((request) =>request.close())
123 .then((response) => response.drain())
124 .then((_) {
125 server.close();
126 asyncEnd();
127 });
128 });
129 }
130
131
112 void main() { 132 void main() {
113 testListenOn(); 133 testListenOn();
114 testHttpServerZone(); 134 testHttpServerZone();
115 testHttpServerZoneError(); 135 testHttpServerZoneError();
136 testAbsoluteUri();
116 } 137 }
OLDNEW
« sdk/lib/io/http.dart ('K') | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698