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

Side by Side Diff: lib/src/util/io.dart

Issue 1263503008: Add an Environment class that's exposed through RunnerSuite. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 5 years, 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library test.util.io; 5 library test.util.io;
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 import 'dart:mirrors'; 10 import 'dart:mirrors';
11 11
12 import 'package:async/async.dart';
13 import 'package:path/path.dart' as p; 12 import 'package:path/path.dart' as p;
14 import 'package:pub_semver/pub_semver.dart'; 13 import 'package:pub_semver/pub_semver.dart';
15 14
16 import '../backend/operating_system.dart'; 15 import '../backend/operating_system.dart';
17 import '../runner/application_exception.dart'; 16 import '../runner/application_exception.dart';
17 import '../util/stream_queue.dart';
18 import '../utils.dart'; 18 import '../utils.dart';
19 19
20 /// The ASCII code for a newline character. 20 /// The ASCII code for a newline character.
21 const _newline = 0xA; 21 const _newline = 0xA;
22 22
23 /// The ASCII code for a carriage return character. 23 /// The ASCII code for a carriage return character.
24 const _carriageReturn = 0xD; 24 const _carriageReturn = 0xD;
25 25
26 /// The root directory of the Dart SDK. 26 /// The root directory of the Dart SDK.
27 final String sdkDir = (() { 27 final String sdkDir = (() {
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 /// returned. 188 /// returned.
189 String libraryPath(Symbol libraryName, {String packageRoot}) { 189 String libraryPath(Symbol libraryName, {String packageRoot}) {
190 var lib = currentMirrorSystem().findLibrary(libraryName); 190 var lib = currentMirrorSystem().findLibrary(libraryName);
191 if (lib.uri.scheme != 'package') return p.fromUri(lib.uri); 191 if (lib.uri.scheme != 'package') return p.fromUri(lib.uri);
192 192
193 // TODO(nweiz): is there a way to avoid assuming this is being run next to a 193 // TODO(nweiz): is there a way to avoid assuming this is being run next to a
194 // packages directory?. 194 // packages directory?.
195 if (packageRoot == null) packageRoot = p.absolute('packages'); 195 if (packageRoot == null) packageRoot = p.absolute('packages');
196 return p.join(packageRoot, p.fromUri(lib.uri.path)); 196 return p.join(packageRoot, p.fromUri(lib.uri.path));
197 } 197 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698