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

Side by Side Diff: utils/tests/pub/version_solver_test.dart

Issue 12213092: Rework Timer interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « utils/testrunner/pipeline_utils.dart ('k') | utils/tests/string_encoding/benchmark_runner.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 pub_update_test; 5 library pub_update_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import '../../pub/lock_file.dart'; 10 import '../../pub/lock_file.dart';
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return new Future<Pubspec>.immediate(_packages[id.description].pubspec); 521 return new Future<Pubspec>.immediate(_packages[id.description].pubspec);
522 } 522 }
523 523
524 void addPackage(Package package) { 524 void addPackage(Package package) {
525 _packages[package.name] = package; 525 _packages[package.name] = package;
526 } 526 }
527 } 527 }
528 528
529 Future fakeAsync(callback()) { 529 Future fakeAsync(callback()) {
530 var completer = new Completer(); 530 var completer = new Completer();
531 new Timer(0, (_) { 531 Timer.run(() {
532 completer.complete(callback()); 532 completer.complete(callback());
533 }); 533 });
534 534
535 return completer.future; 535 return completer.future;
536 } 536 }
537 537
538 Pair<String, Source> parseSource(String name) { 538 Pair<String, Source> parseSource(String name) {
539 var match = new RegExp(r"(.*) from (.*)").firstMatch(name); 539 var match = new RegExp(r"(.*) from (.*)").firstMatch(name);
540 if (match == null) return new Pair<String, Source>(name, source1); 540 if (match == null) return new Pair<String, Source>(name, source1);
541 switch (match[2]) { 541 switch (match[2]) {
542 case 'mock1': return new Pair<String, Source>(match[1], source1); 542 case 'mock1': return new Pair<String, Source>(match[1], source1);
543 case 'mock2': return new Pair<String, Source>(match[1], source2); 543 case 'mock2': return new Pair<String, Source>(match[1], source2);
544 case 'root': return new Pair<String, Source>(match[1], null); 544 case 'root': return new Pair<String, Source>(match[1], null);
545 case 'versionless': 545 case 'versionless':
546 return new Pair<String, Source>(match[1], versionlessSource); 546 return new Pair<String, Source>(match[1], versionlessSource);
547 } 547 }
548 } 548 }
OLDNEW
« no previous file with comments | « utils/testrunner/pipeline_utils.dart ('k') | utils/tests/string_encoding/benchmark_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698