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

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

Issue 52853004: Pass in "mode" to transformer plugins. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: "transformer" -> "configuration". Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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 library pub_tests; 5 library pub_tests;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 /// Reads lines from pub serve's stdout until it prints the build success 182 /// Reads lines from pub serve's stdout until it prints the build success
183 /// message. 183 /// message.
184 /// 184 ///
185 /// The schedule will not proceed until the output is found. If not found, it 185 /// The schedule will not proceed until the output is found. If not found, it
186 /// will eventually time out. 186 /// will eventually time out.
187 void waitForBuildSuccess() { 187 void waitForBuildSuccess() {
188 nextLine() { 188 nextLine() {
189 return _pubServer.nextLine().then((line) { 189 return _pubServer.nextLine().then((line) {
190 if (line.contains("successfully")) return; 190 if (line.contains("successfully")) return null;
191 191
192 // This line wasn't it, so ignore it and keep trying. 192 // This line wasn't it, so ignore it and keep trying.
193 return nextLine(); 193 return nextLine();
194 }); 194 });
195 } 195 }
196 196
197 schedule(nextLine); 197 schedule(nextLine);
198 } 198 }
199 199
200 /// Schedules opening a web socket connection to the currently running pub 200 /// Schedules opening a web socket connection to the currently running pub
(...skipping 21 matching lines...) Expand all
222 /// socket. It omitted, request is JSON encoded to a string first. 222 /// socket. It omitted, request is JSON encoded to a string first.
223 void webSocketShouldReply(request, expectation, {bool encodeRequest: true}) { 223 void webSocketShouldReply(request, expectation, {bool encodeRequest: true}) {
224 schedule(() => _ensureWebSocket().then((_) { 224 schedule(() => _ensureWebSocket().then((_) {
225 if (encodeRequest) request = JSON.encode(request); 225 if (encodeRequest) request = JSON.encode(request);
226 _webSocket.add(request); 226 _webSocket.add(request);
227 return _webSocketBroadcastStream.first.then((value) { 227 return _webSocketBroadcastStream.first.then((value) {
228 expect(JSON.decode(value), expectation); 228 expect(JSON.decode(value), expectation);
229 }); 229 });
230 }), "send $request to web socket and expect reply that $expectation"); 230 }), "send $request to web socket and expect reply that $expectation");
231 } 231 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698