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

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

Issue 955543002: Move a bunch of src/ files into subdirectories. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Fix library tags Created 5 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/util/exit_codes.dart ('k') | lib/src/util/isolate_wrapper.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) 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 unittest.io; 5 library unittest.util.io;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
11 11
12 /// Returns whether the current Dart version supports [Isolate.kill]. 12 /// Returns whether the current Dart version supports [Isolate.kill].
13 final bool supportsIsolateKill = _supportsIsolateKill; 13 final bool supportsIsolateKill = _supportsIsolateKill;
14 bool get _supportsIsolateKill { 14 bool get _supportsIsolateKill {
15 // This isn't 100% accurate, since early 1.9 dev releases didn't support 15 // This isn't 100% accurate, since early 1.9 dev releases didn't support
(...skipping 30 matching lines...) Expand all
46 /// [fn] completes to. 46 /// [fn] completes to.
47 Future withTempDir(Future fn(String path)) { 47 Future withTempDir(Future fn(String path)) {
48 return new Future.sync(() { 48 return new Future.sync(() {
49 // TODO(nweiz): Empirically test whether sync or async functions perform 49 // TODO(nweiz): Empirically test whether sync or async functions perform
50 // better here when starting a bunch of isolates. 50 // better here when starting a bunch of isolates.
51 var tempDir = Directory.systemTemp.createTempSync('unittest_'); 51 var tempDir = Directory.systemTemp.createTempSync('unittest_');
52 return new Future.sync(() => fn(tempDir.path)) 52 return new Future.sync(() => fn(tempDir.path))
53 .whenComplete(() => tempDir.deleteSync(recursive: true)); 53 .whenComplete(() => tempDir.deleteSync(recursive: true));
54 }); 54 });
55 } 55 }
OLDNEW
« no previous file with comments | « lib/src/util/exit_codes.dart ('k') | lib/src/util/isolate_wrapper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698