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

Side by Side Diff: sdk/lib/_internal/pub/test/test_pub.dart

Issue 227563010: pkg/shelf: case-insensitive headers, cleaner Request ctor, a lot more tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixing dependent code, changelog Created 6 years, 8 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 | « sdk/lib/_internal/pub/lib/src/oauth2.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 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub
6 /// tests are integration tests that stage some stuff on the file system, run 6 /// tests are integration tests that stage some stuff on the file system, run
7 /// pub, and then validate the results. This library provides an API to build 7 /// pub, and then validate the results. This library provides an API to build
8 /// tests like that. 8 /// tests like that.
9 library test_pub; 9 library test_pub;
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 /// Subsequent calls to [serve] will replace the previous server. 101 /// Subsequent calls to [serve] will replace the previous server.
102 void serve([List<d.Descriptor> contents]) { 102 void serve([List<d.Descriptor> contents]) {
103 var baseDir = d.dir("serve-dir", contents); 103 var baseDir = d.dir("serve-dir", contents);
104 104
105 _hasServer = true; 105 _hasServer = true;
106 106
107 schedule(() { 107 schedule(() {
108 return _closeServer().then((_) { 108 return _closeServer().then((_) {
109 return shelf_io.serve((request) { 109 return shelf_io.serve((request) {
110 currentSchedule.heartbeat(); 110 currentSchedule.heartbeat();
111 var path = request.pathInfo.replaceFirst("/", ""); 111 var path = request.url.path.replaceFirst("/", "");
112 _requestedPaths.add(path); 112 _requestedPaths.add(path);
113 113
114 return validateStream(baseDir.load(path)) 114 return validateStream(baseDir.load(path))
115 .then((stream) => new shelf.Response.ok(stream)) 115 .then((stream) => new shelf.Response.ok(stream))
116 .catchError((error) { 116 .catchError((error) {
117 return new shelf.Response.notFound('File "$path" not found.'); 117 return new shelf.Response.notFound('File "$path" not found.');
118 }); 118 });
119 }, '127.0.0.1', 0).then((server) { 119 }, '127.0.0.1', 0).then((server) {
120 _server = server; 120 _server = server;
121 _portCompleter.complete(_server.port); 121 _portCompleter.complete(_server.port);
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 _lastMatcher.matches(item.last, matchState); 843 _lastMatcher.matches(item.last, matchState);
844 } 844 }
845 845
846 Description describe(Description description) { 846 Description describe(Description description) {
847 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 847 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
848 } 848 }
849 } 849 }
850 850
851 /// A [StreamMatcher] that matches multiple lines of output. 851 /// A [StreamMatcher] that matches multiple lines of output.
852 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); 852 StreamMatcher emitsLines(String output) => inOrder(output.split("\n"));
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/oauth2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698