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); |
} |