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

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

Issue 52723007: Revert "Change dart:io Platform.script to return a Uri." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « pkg/scheduled_test/test/metatest.dart ('k') | pkg/third_party/html5lib/test/support.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 scheduled_process_test; 5 library scheduled_process_test;
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 }); 358 });
359 } 359 }
360 360
361 ScheduledProcess startDartProcess(String script) { 361 ScheduledProcess startDartProcess(String script) {
362 var tempDir = schedule(() => Directory.systemTemp 362 var tempDir = schedule(() => Directory.systemTemp
363 .createTemp('scheduled_process_test_') 363 .createTemp('scheduled_process_test_')
364 .then((dir) => dir.path), 364 .then((dir) => dir.path),
365 'create temp dir'); 365 'create temp dir');
366 var dartPath = schedule(() { 366 var dartPath = schedule(() {
367 return tempDir.then((dir) { 367 return tempDir.then((dir) {
368 var utilsPath = path.absolute(path.join(Platform.script, 'utils.dart'));
368 return new File(path.join(dir, 'test.dart')).writeAsString(''' 369 return new File(path.join(dir, 'test.dart')).writeAsString('''
369 import 'dart:async'; 370 import 'dart:async';
370 import 'dart:convert'; 371 import 'dart:convert';
371 import 'dart:io'; 372 import 'dart:io';
372 373
373 var stdinLines = stdin 374 var stdinLines = stdin
374 .transform(UTF8.decoder) 375 .transform(UTF8.decoder)
375 .transform(new LineSplitter()); 376 .transform(new LineSplitter());
376 377
377 void main() { 378 void main() {
378 $script 379 $script
379 } 380 }
380 ''').then((file) => file.path); 381 ''').then((file) => file.path);
381 }); 382 });
382 }, 'write script file'); 383 }, 'write script file');
383 384
384 currentSchedule.onComplete.schedule(() { 385 currentSchedule.onComplete.schedule(() {
385 return tempDir.catchError((_) => null).then((dir) { 386 return tempDir.catchError((_) => null).then((dir) {
386 if (dir == null) return; 387 if (dir == null) return;
387 return new Directory(dir).delete(recursive: true); 388 return new Directory(dir).delete(recursive: true);
388 }); 389 });
389 }, 'clean up temp dir'); 390 }, 'clean up temp dir');
390 391
391 return new ScheduledProcess.start(Platform.executable, 392 return new ScheduledProcess.start(Platform.executable,
392 ['--checked', dartPath]); 393 ['--checked', dartPath]);
393 } 394 }
OLDNEW
« no previous file with comments | « pkg/scheduled_test/test/metatest.dart ('k') | pkg/third_party/html5lib/test/support.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698