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

Side by Side Diff: pkg/barback/test/utils.dart

Issue 18854007: Binary assets and more unit tests for Asset. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 5 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
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 barback.test.utils; 5 library barback.test.utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:io';
9 10
10 import 'package:barback/barback.dart'; 11 import 'package:barback/barback.dart';
11 import 'package:barback/src/asset_graph.dart'; 12 import 'package:barback/src/asset_graph.dart';
12 import 'package:pathos/path.dart' as pathos; 13 import 'package:pathos/path.dart' as pathos;
13 import 'package:scheduled_test/scheduled_test.dart'; 14 import 'package:scheduled_test/scheduled_test.dart';
14 15
15 // TODO(rnystrom): Get rid of this or find a better path for it. 16 // TODO(rnystrom): Get rid of this or find a better path for it.
16 import '../../../sdk/lib/_internal/pub/test/command_line_config.dart'; 17 import '../../../sdk/lib/_internal/pub/test/command_line_config.dart';
17 18
18 var _configured = false; 19 var _configured = false;
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 451 }
451 } 452 }
452 453
453 /// An implementation of [Asset] that never hits the file system. 454 /// An implementation of [Asset] that never hits the file system.
454 class MockAsset implements Asset { 455 class MockAsset implements Asset {
455 final AssetId id; 456 final AssetId id;
456 String contents; 457 String contents;
457 458
458 MockAsset(this.id, this.contents); 459 MockAsset(this.id, this.contents);
459 460
460 Future<String> readAsString() => new Future.value(contents); 461 Future<String> readAsString({Encoding encoding}) =>
462 new Future.value(contents);
463
461 Stream<List<int>> read() => throw new UnimplementedError(); 464 Stream<List<int>> read() => throw new UnimplementedError();
462 465
463 serialize() => throw new UnimplementedError();
464
465 String toString() => "MockAsset $id $contents"; 466 String toString() => "MockAsset $id $contents";
466 } 467 }
OLDNEW
« pkg/barback/test/asset_test.dart ('K') | « pkg/barback/test/asset_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698