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

Side by Side Diff: pkg/scheduled_test/test/descriptor_test.dart

Issue 12540010: Work around issue 9252 in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also fix pkg/http. Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « pkg/http/test/utils.dart ('k') | pkg/scheduled_test/test/scheduled_process_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 library descriptor_test; 5 library descriptor_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import '../../../pkg/pathos/lib/path.dart' as path; 10 import '../../../pkg/pathos/lib/path.dart' as path;
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 sandbox = dir.path; 904 sandbox = dir.path;
905 d.defaultRoot = sandbox; 905 d.defaultRoot = sandbox;
906 }); 906 });
907 }); 907 });
908 908
909 currentSchedule.onComplete.schedule(() { 909 currentSchedule.onComplete.schedule(() {
910 d.defaultRoot = null; 910 d.defaultRoot = null;
911 if (sandbox == null) return; 911 if (sandbox == null) return;
912 var oldSandbox = sandbox; 912 var oldSandbox = sandbox;
913 sandbox = null; 913 sandbox = null;
914 return new Directory(oldSandbox).delete(recursive: true); 914 return deleteDir(oldSandbox);
915 }); 915 });
916 } 916 }
917 917
918 Future<List<int>> byteStreamToList(Stream<List<int>> stream) { 918 Future<List<int>> byteStreamToList(Stream<List<int>> stream) {
919 return stream.reduce(<int>[], (buffer, chunk) { 919 return stream.reduce(<int>[], (buffer, chunk) {
920 buffer.addAll(chunk); 920 buffer.addAll(chunk);
921 return buffer; 921 return buffer;
922 }); 922 });
923 } 923 }
924 924
925 Future<String> byteStreamToString(Stream<List<int>> stream) => 925 Future<String> byteStreamToString(Stream<List<int>> stream) =>
926 byteStreamToList(stream).then((bytes) => new String.fromCharCodes(bytes)); 926 byteStreamToList(stream).then((bytes) => new String.fromCharCodes(bytes));
OLDNEW
« no previous file with comments | « pkg/http/test/utils.dart ('k') | pkg/scheduled_test/test/scheduled_process_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698