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

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

Issue 12613010: Update pub to use the latest dart:io stream APIs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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/tests/pub/pub_lish_test.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 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 return timeout(_stderrFuture.then((stream) => stream.toList()) 1432 return timeout(_stderrFuture.then((stream) => stream.toList())
1433 .then((lines) => lines.join("\n")), 1433 .then((lines) => lines.join("\n")),
1434 _SCHEDULE_TIMEOUT, 1434 _SCHEDULE_TIMEOUT,
1435 "waiting for the last stderr line from process $name"); 1435 "waiting for the last stderr line from process $name");
1436 }); 1436 });
1437 } 1437 }
1438 1438
1439 /// Writes [line] to the process as stdin. 1439 /// Writes [line] to the process as stdin.
1440 void writeLine(String line) { 1440 void writeLine(String line) {
1441 _schedule((_) => _processFuture.then( 1441 _schedule((_) => _processFuture.then(
1442 (p) => p.stdin.writeln('$line'))); 1442 (p) => p.stdin.add(encodeUtf8('$line\n'))));
1443 } 1443 }
1444 1444
1445 /// Kills the process, and waits until it's dead. 1445 /// Kills the process, and waits until it's dead.
1446 void kill() { 1446 void kill() {
1447 _endScheduled = true; 1447 _endScheduled = true;
1448 _schedule((_) { 1448 _schedule((_) {
1449 _endExpected = true; 1449 _endExpected = true;
1450 _process.kill(); 1450 _process.kill();
1451 timeout(_exitCodeFuture, _SCHEDULE_TIMEOUT, 1451 timeout(_exitCodeFuture, _SCHEDULE_TIMEOUT,
1452 "waiting for process $name to die"); 1452 "waiting for process $name to die");
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 /// calling [completion] is unnecessary. 1633 /// calling [completion] is unnecessary.
1634 void expectLater(Future actual, matcher, {String reason, 1634 void expectLater(Future actual, matcher, {String reason,
1635 FailureHandler failureHandler, bool verbose: false}) { 1635 FailureHandler failureHandler, bool verbose: false}) {
1636 _schedule((_) { 1636 _schedule((_) {
1637 return actual.then((value) { 1637 return actual.then((value) {
1638 expect(value, matcher, reason: reason, failureHandler: failureHandler, 1638 expect(value, matcher, reason: reason, failureHandler: failureHandler,
1639 verbose: false); 1639 verbose: false);
1640 }); 1640 });
1641 }); 1641 });
1642 } 1642 }
OLDNEW
« no previous file with comments | « utils/tests/pub/pub_lish_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698