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

Unified Diff: sdk/lib/_internal/pub/test/oauth2/utils.dart

Issue 164773003: Change ScheduledProcess's output streams over to be ScheduledStreams. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/oauth2/utils.dart
diff --git a/sdk/lib/_internal/pub/test/oauth2/utils.dart b/sdk/lib/_internal/pub/test/oauth2/utils.dart
index 27280b047cc9db1a4969bca8e4d20039db547f6a..5144dade17511ffe2dd3dc8839a9d35c5e99a8eb 100644
--- a/sdk/lib/_internal/pub/test/oauth2/utils.dart
+++ b/sdk/lib/_internal/pub/test/oauth2/utils.dart
@@ -17,22 +17,24 @@ import '../../lib/src/utils.dart';
void authorizePub(ScheduledProcess pub, ScheduledServer server,
[String accessToken="access token"]) {
- expect(pub.nextLine(), completion(equals('Pub needs your authorization to '
- 'upload packages on your behalf.')));
-
- expect(pub.nextLine().then((line) {
- var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z.%+-]+)[$&]')
- .firstMatch(line);
- expect(match, isNotNull);
-
- var redirectUrl = Uri.parse(Uri.decodeComponent(match.group(1)));
- redirectUrl = addQueryParameters(redirectUrl, {'code': 'access code'});
- return (new http.Request('GET', redirectUrl)..followRedirects = false)
- .send();
- }).then((response) {
- expect(response.headers['location'],
- equals('http://pub.dartlang.org/authorized'));
- }), completes);
+ pub.stdout.expect('Pub needs your authorization to upload packages on your '
+ 'behalf.');
+
+ schedule(() {
+ return pub.stdout.next().then((line) {
+ var match = new RegExp(r'[?&]redirect_uri=([0-9a-zA-Z.%+-]+)[$&]')
+ .firstMatch(line);
+ expect(match, isNotNull);
+
+ var redirectUrl = Uri.parse(Uri.decodeComponent(match.group(1)));
+ redirectUrl = addQueryParameters(redirectUrl, {'code': 'access code'});
+ return (new http.Request('GET', redirectUrl)..followRedirects = false)
+ .send();
+ }).then((response) {
+ expect(response.headers['location'],
+ equals('http://pub.dartlang.org/authorized'));
+ });
+ });
handleAccessTokenRequest(server, accessToken);
}

Powered by Google App Engine
This is Rietveld 408576698