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

Side by Side Diff: pkg/barback/test/package_graph/repetition_test.dart

Issue 49223004: Revise several already-committed CLs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review 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/barback/lib/src/pool.dart ('k') | sdk/lib/_internal/pub/lib/src/barback.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.package_graph.transform_test; 5 library barback.test.package_graph.transform_test;
6 6
7 import 'package:barback/src/utils.dart'; 7 import 'package:barback/src/utils.dart';
8 import 'package:scheduled_test/scheduled_test.dart'; 8 import 'package:scheduled_test/scheduled_test.dart';
9 9
10 import '../utils.dart'; 10 import '../utils.dart';
11 11
12 // This tests the behavior of barback under many operations happening in quick
13 // succession. Since Barback is so asynchronous, it's easy for it to have subtle
14 // dependencies on the commonly-used and -tested usage patterns. These tests
15 // exist to stress-test less-common usage patterns in order to root out
16 // additional bugs.
17
12 main() { 18 main() {
13 initConfig(); 19 initConfig();
14 20
15 test("updates sources many times", () { 21 test("updates sources many times", () {
16 initGraph(["app|foo.txt"], { 22 initGraph(["app|foo.txt"], {
17 "app": [[new RewriteTransformer("txt", "out")]] 23 "app": [[new RewriteTransformer("txt", "out")]]
18 }); 24 });
19 25
20 for (var i = 0; i < 1000; i++) { 26 for (var i = 0; i < 1000; i++) {
21 updateSources(["app|foo.txt"]); 27 updateSources(["app|foo.txt"]);
(...skipping 16 matching lines...) Expand all
38 expectNoAsset("app|foo.out"); 44 expectNoAsset("app|foo.out");
39 expectNoAsset("app|foo.txt"); 45 expectNoAsset("app|foo.txt");
40 buildShouldSucceed(); 46 buildShouldSucceed();
41 }); 47 });
42 48
43 test("updates transformers many times", () { 49 test("updates transformers many times", () {
44 var rewrite = new RewriteTransformer("txt", "out"); 50 var rewrite = new RewriteTransformer("txt", "out");
45 initGraph(["app|foo.txt"], {"app": [[rewrite]]}); 51 initGraph(["app|foo.txt"], {"app": [[rewrite]]});
46 updateSources(["app|foo.txt"]); 52 updateSources(["app|foo.txt"]);
47 53
48 for (var i = 0; i < 1; i++) { 54 for (var i = 0; i < 1000; i++) {
49 updateTransformers("app", [[rewrite]]); 55 updateTransformers("app", [[rewrite]]);
50 } 56 }
51 57
52 expectAsset("app|foo.out", "foo.out"); 58 expectAsset("app|foo.out", "foo.out");
53 buildShouldSucceed(); 59 buildShouldSucceed();
54 }); 60 });
55 61
56 test("updates and removes transformers many times", () { 62 test("updates and removes transformers many times", () {
57 var rewrite = new RewriteTransformer("txt", "out"); 63 var rewrite = new RewriteTransformer("txt", "out");
58 initGraph(["app|foo.txt"], {"app": [[rewrite]]}); 64 initGraph(["app|foo.txt"], {"app": [[rewrite]]});
59 updateSources(["app|foo.txt"]); 65 updateSources(["app|foo.txt"]);
60 66
61 for (var i = 0; i < 1; i++) { 67 for (var i = 0; i < 1000; i++) {
62 updateTransformers("app", [[rewrite]]); 68 updateTransformers("app", [[rewrite]]);
63 updateTransformers("app", [[]]); 69 updateTransformers("app", [[]]);
64 } 70 }
65 71
66 expectAsset("app|foo.txt", "foo"); 72 expectAsset("app|foo.txt", "foo");
67 expectNoAsset("app|foo.out"); 73 expectNoAsset("app|foo.out");
68 buildShouldSucceed(); 74 buildShouldSucceed();
69 }); 75 });
70 } 76 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/pool.dart ('k') | sdk/lib/_internal/pub/lib/src/barback.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698