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

Unified Diff: pkg/front_end/test/incremental_kernel_generator_test.dart

Issue 2936313003: Test for the case when the watch function is null. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/incremental_kernel_generator_test.dart
diff --git a/pkg/front_end/test/incremental_kernel_generator_test.dart b/pkg/front_end/test/incremental_kernel_generator_test.dart
index 525349477a58ce6821bdd91e5d392a85778a0f30..551d7957d7e1b24a1f813cf965dfbdea24ae5d95 100644
--- a/pkg/front_end/test/incremental_kernel_generator_test.dart
+++ b/pkg/front_end/test/incremental_kernel_generator_test.dart
@@ -368,15 +368,6 @@ class C {
}
}
- void _assertCompiledUris(Iterable<Uri> expected) {
- var compiledCycles = incrementalKernelGenerator.test.compiledCycles;
- Set<Uri> compiledUris = compiledCycles
- .map((cycle) => cycle.libraries.map((file) => file.uri))
- .expand((uris) => uris)
- .toSet();
- expect(compiledUris, unorderedEquals(expected));
- }
-
test_compile_typedef() async {
writeFile('/test/.packages', 'test:lib/');
String aPath = '/test/lib/a.dart';
@@ -822,6 +813,26 @@ import 'a.dart';
}
}
+ test_watch_null() async {
+ writeFile('/test/.packages', 'test:lib/');
+ String aPath = '/test/lib/a.dart';
+ String bPath = '/test/lib/b.dart';
+ Uri aUri = writeFile(aPath, "");
+ Uri bUri = writeFile(bPath, "");
+
+ // Set null, as if the watch function is not provided.
+ watchFn = null;
+
+ await getInitialState(bUri);
+
+ // Update b.dart to import a.dart file.
+ writeFile(bPath, "import 'a.dart';");
+ incrementalKernelGenerator.invalidate(bUri);
+ await incrementalKernelGenerator.computeDelta();
+
+ // No exception even though the watcher function is null.
+ }
+
/// Write the given [text] of the file with the given [path] into the
/// virtual filesystem. Return the URI of the file.
Uri writeFile(String path, String text) {
@@ -835,6 +846,15 @@ import 'a.dart';
contents.forEach(writeFile);
}
+ void _assertCompiledUris(Iterable<Uri> expected) {
+ var compiledCycles = incrementalKernelGenerator.test.compiledCycles;
+ Set<Uri> compiledUris = compiledCycles
+ .map((cycle) => cycle.libraries.map((file) => file.uri))
+ .expand((uris) => uris)
+ .toSet();
+ expect(compiledUris, unorderedEquals(expected));
+ }
+
void _assertLibraryUris(Program program,
{List<Uri> includes: const [], List<Uri> excludes: const []}) {
List<Uri> libraryUris =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698