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 = |