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

Unified Diff: pkg/barback/test/package_graph/source_test.dart

Issue 21275003: Move barback to a more event-based model. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/barback/test/package_graph/errors_test.dart ('k') | pkg/barback/test/package_graph/transform_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/test/package_graph/source_test.dart
diff --git a/pkg/barback/test/package_graph/source_test.dart b/pkg/barback/test/package_graph/source_test.dart
index 0185679954c9b3b99ce0b716dad038923c0f8f1a..e6627e73bbbec87853bb8be0c42a6e63cccabd50 100644
--- a/pkg/barback/test/package_graph/source_test.dart
+++ b/pkg/barback/test/package_graph/source_test.dart
@@ -7,6 +7,7 @@ library barback.test.package_graph.source_test;
import 'dart:async';
import 'package:barback/barback.dart';
+import 'package:barback/src/utils.dart';
import 'package:scheduled_test/scheduled_test.dart';
import '../utils.dart';
@@ -112,6 +113,24 @@ main() {
buildShouldSucceed();
});
+ test("reloads an asset that's updated while loading", () {
+ initGraph({"app|foo.txt": "foo"});
+
+ pauseProvider();
+ schedule(() {
+ // The mock provider synchronously loads the value of the assets, so this
+ // will kick off two loads with different values. The second one should
+ // win.
+ updateSources(["app|foo.txt"]);
+ modifyAsset("app|foo.txt", "bar");
+ updateSources(["app|foo.txt"]);
+ });
+
+ resumeProvider();
+ expectAsset("app|foo.txt", "bar");
+ buildShouldSucceed();
+ });
+
test("restarts a build if a source is updated while sources are loading", () {
var transformer = new RewriteTransformer("txt", "out");
initGraph(["app|foo.txt", "app|other.bar"], {"app": [[transformer]]});
« no previous file with comments | « pkg/barback/test/package_graph/errors_test.dart ('k') | pkg/barback/test/package_graph/transform_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698