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

Side by Side Diff: lib/src/utils.dart

Issue 1685363002: Add a platform plugin infrastructure. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 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 unified diff | Download patch
« no previous file with comments | « lib/src/runner/vm/platform.dart ('k') | lib/test.dart » ('j') | 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 8
9 import 'package:async/async.dart' hide StreamQueue; 9 import 'package:async/async.dart' hide StreamQueue;
10 import 'package:crypto/crypto.dart'; 10 import 'package:crypto/crypto.dart';
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 new RegExp(r"/test_[A-Za-z0-9]{6}/runInIsolate\.dart$"); 170 new RegExp(r"/test_[A-Za-z0-9]{6}/runInIsolate\.dart$");
171 171
172 /// Returns [stackTrace] converted to a [Chain] with all irrelevant frames 172 /// Returns [stackTrace] converted to a [Chain] with all irrelevant frames
173 /// folded together. 173 /// folded together.
174 /// 174 ///
175 /// If [verbose] is `true`, returns the chain for [stackTrace] unmodified. 175 /// If [verbose] is `true`, returns the chain for [stackTrace] unmodified.
176 Chain terseChain(StackTrace stackTrace, {bool verbose: false}) { 176 Chain terseChain(StackTrace stackTrace, {bool verbose: false}) {
177 if (verbose) return new Chain.forTrace(stackTrace); 177 if (verbose) return new Chain.forTrace(stackTrace);
178 return new Chain.forTrace(stackTrace).foldFrames((frame) { 178 return new Chain.forTrace(stackTrace).foldFrames((frame) {
179 if (frame.package == 'test') return true; 179 if (frame.package == 'test') return true;
180 if (frame.package == 'stream_channel') return true;
180 181
181 // Filter out frames from our isolate bootstrap as well. 182 // Filter out frames from our isolate bootstrap as well.
182 if (frame.uri.scheme != 'file') return false; 183 if (frame.uri.scheme != 'file') return false;
183 return frame.uri.path.contains(_isolatePath); 184 return frame.uri.path.contains(_isolatePath);
184 }, terse: true); 185 }, terse: true);
185 } 186 }
186 187
187 /// Flattens nested [Iterable]s inside an [Iterable] into a single [List] 188 /// Flattens nested [Iterable]s inside an [Iterable] into a single [List]
188 /// containing only non-[Iterable] elements. 189 /// containing only non-[Iterable] elements.
189 List flatten(Iterable nested) { 190 List flatten(Iterable nested) {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 urlSafe: urlSafe, addLineSeparator: addLineSeparator); 417 urlSafe: urlSafe, addLineSeparator: addLineSeparator);
417 } 418 }
418 419
419 /// Returns middleware that nests all requests beneath the URL prefix [beneath]. 420 /// Returns middleware that nests all requests beneath the URL prefix [beneath].
420 shelf.Middleware nestingMiddleware(String beneath) { 421 shelf.Middleware nestingMiddleware(String beneath) {
421 return (handler) { 422 return (handler) {
422 var pathHandler = new PathHandler()..add(beneath, handler); 423 var pathHandler = new PathHandler()..add(beneath, handler);
423 return pathHandler.handler; 424 return pathHandler.handler;
424 }; 425 };
425 } 426 }
OLDNEW
« no previous file with comments | « lib/src/runner/vm/platform.dart ('k') | lib/test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698