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

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

Issue 18811008: Tweak unittest compact config a bit and don't use it on bots. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix comment. 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
« no previous file with comments | « pkg/barback/pubspec.yaml ('k') | pkg/unittest/lib/compact_vm_config.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 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 import 'dart:io';
10 10
11 import 'package:barback/barback.dart'; 11 import 'package:barback/barback.dart';
12 import 'package:barback/src/asset_graph.dart'; 12 import 'package:barback/src/asset_graph.dart';
13 import 'package:pathos/path.dart' as pathos; 13 import 'package:pathos/path.dart' as pathos;
14 import 'package:scheduled_test/scheduled_test.dart'; 14 import 'package:scheduled_test/scheduled_test.dart';
15 15 import 'package:unittest/compact_vm_config.dart';
16 // TODO(rnystrom): Get rid of this or find a better path for it.
17 import '../../../sdk/lib/_internal/pub/test/command_line_config.dart';
18 16
19 var _configured = false; 17 var _configured = false;
20 18
21 MockProvider _provider; 19 MockProvider _provider;
22 AssetGraph _graph; 20 AssetGraph _graph;
23 21
24 /// Calls to [buildShouldSucceed] and [buildShouldFail] set expectations on 22 /// Calls to [buildShouldSucceed] and [buildShouldFail] set expectations on
25 /// successive [BuildResult]s from [_graph]. This keeps track of how many calls 23 /// successive [BuildResult]s from [_graph]. This keeps track of how many calls
26 /// have already been made so later calls know which result to look for. 24 /// have already been made so later calls know which result to look for.
27 int _nextBuildResult; 25 int _nextBuildResult;
28 26
29 void initConfig() { 27 void initConfig() {
30 if (_configured) return; 28 if (_configured) return;
31 _configured = true; 29 _configured = true;
32 unittestConfiguration = new CommandLineConfiguration(); 30 useCompactVMConfiguration();
33 } 31 }
34 32
35 /// Creates a new [AssetProvider] and [AssetGraph] with the given [assets] and 33 /// Creates a new [AssetProvider] and [AssetGraph] with the given [assets] and
36 /// [transformers]. 34 /// [transformers].
37 /// 35 ///
38 /// This graph is used internally by most of the other functions in this 36 /// This graph is used internally by most of the other functions in this
39 /// library so you must call it in the test before calling any of the other 37 /// library so you must call it in the test before calling any of the other
40 /// functions. 38 /// functions.
41 /// 39 ///
42 /// [assets] may either be an [Iterable] or a [Map]. If it's an [Iterable], 40 /// [assets] may either be an [Iterable] or a [Map]. If it's an [Iterable],
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 473
476 MockAsset(this.id, this.contents); 474 MockAsset(this.id, this.contents);
477 475
478 Future<String> readAsString({Encoding encoding}) => 476 Future<String> readAsString({Encoding encoding}) =>
479 new Future.value(contents); 477 new Future.value(contents);
480 478
481 Stream<List<int>> read() => throw new UnimplementedError(); 479 Stream<List<int>> read() => throw new UnimplementedError();
482 480
483 String toString() => "MockAsset $id $contents"; 481 String toString() => "MockAsset $id $contents";
484 } 482 }
OLDNEW
« no previous file with comments | « pkg/barback/pubspec.yaml ('k') | pkg/unittest/lib/compact_vm_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698