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

Side by Side Diff: utils/tests/pub/test_pub.dart

Issue 14150002: Remove StreamSink(replaced by EventSink) and make IOSink extend EventSink. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « utils/pub/safe_http_server.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 server.listen((request) { 87 server.listen((request) {
88 var response = request.response; 88 var response = request.response;
89 try { 89 try {
90 var path = request.uri.path.replaceFirst("/", ""); 90 var path = request.uri.path.replaceFirst("/", "");
91 response.persistentConnection = false; 91 response.persistentConnection = false;
92 var stream = baseDir.load(path); 92 var stream = baseDir.load(path);
93 93
94 new ByteStream(stream).toBytes().then((data) { 94 new ByteStream(stream).toBytes().then((data) {
95 response.statusCode = 200; 95 response.statusCode = 200;
96 response.contentLength = data.length; 96 response.contentLength = data.length;
97 response.writeBytes(data); 97 response.add(data);
98 response.close(); 98 response.close();
99 }).catchError((e) { 99 }).catchError((e) {
100 response.statusCode = 404; 100 response.statusCode = 404;
101 response.contentLength = 0; 101 response.contentLength = 0;
102 response.close(); 102 response.close();
103 }); 103 });
104 } catch (e) { 104 } catch (e) {
105 currentSchedule.signalError(e); 105 currentSchedule.signalError(e);
106 response.statusCode = 500; 106 response.statusCode = 500;
107 response.close(); 107 response.close();
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 bool matches(item, MatchState matchState) { 610 bool matches(item, MatchState matchState) {
611 if (item is! Pair) return false; 611 if (item is! Pair) return false;
612 return _firstMatcher.matches(item.first, matchState) && 612 return _firstMatcher.matches(item.first, matchState) &&
613 _lastMatcher.matches(item.last, matchState); 613 _lastMatcher.matches(item.last, matchState);
614 } 614 }
615 615
616 Description describe(Description description) { 616 Description describe(Description description) {
617 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 617 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
618 } 618 }
619 } 619 }
OLDNEW
« no previous file with comments | « utils/pub/safe_http_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698