Update dart2js_dynamic_test to exclude CFE code.

Change-Id: I849611da80a2d2bc86c267664508af30dc56b382
Reviewed-on: https://dart-review.googlesource.com/75841
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/tests/compiler/dart2js/analyses/analysis_helper.dart b/tests/compiler/dart2js/analyses/analysis_helper.dart
index ee752d2..678c573 100644
--- a/tests/compiler/dart2js/analyses/analysis_helper.dart
+++ b/tests/compiler/dart2js/analyses/analysis_helper.dart
@@ -21,7 +21,7 @@
 
 import '../helpers/memory_compiler.dart';
 
-run(Uri entryPoint, String allowedListPath,
+run(Uri entryPoint, String allowedListPath, List<String> analyzedPaths,
     {Map<String, String> memorySourceFiles = const {},
     bool verbose = false,
     bool generate = false}) {
@@ -29,8 +29,8 @@
     Compiler compiler = await compilerFor(memorySourceFiles: memorySourceFiles);
     LoadedLibraries loadedLibraries =
         await compiler.libraryLoader.loadLibraries(entryPoint);
-    new DynamicVisitor(
-            compiler.reporter, loadedLibraries.component, allowedListPath)
+    new DynamicVisitor(compiler.reporter, loadedLibraries.component,
+            allowedListPath, analyzedPaths)
         .run(verbose: verbose, generate: generate);
   });
 }
@@ -90,11 +90,13 @@
   final DiagnosticReporter reporter;
   final ir.Component component;
   final String _allowedListPath;
+  final List<String> analyzedPaths;
 
   Map _expectedJson = {};
   Map<String, Map<String, List<DiagnosticMessage>>> _actualMessages = {};
 
-  DynamicVisitor(this.reporter, this.component, this._allowedListPath);
+  DynamicVisitor(
+      this.reporter, this.component, this._allowedListPath, this.analyzedPaths);
 
   void run({bool verbose = false, bool generate = false}) {
     if (!generate) {
@@ -188,15 +190,15 @@
       print("""
 
 ********************************************************************************
-  Unexpected dynamic invocations found by test:
-
-    ${relativize(Uri.base, Platform.script, Platform.isWindows)}
-
-  Please address the reported errors, or, if the errors are as expected, run
-
-    dart ${relativize(Uri.base, Platform.script, Platform.isWindows)} -g
-
-  to update the expectation file.
+*  Unexpected dynamic invocations found by test:
+*
+*    ${relativize(Uri.base, Platform.script, Platform.isWindows)}
+*
+*  Please address the reported errors, or, if the errors are as expected, run
+*
+*    dart ${relativize(Uri.base, Platform.script, Platform.isWindows)} -g
+*
+*  to update the expectation file.
 ********************************************************************************
 """);
       exit(-1);
@@ -231,6 +233,14 @@
     }
   }
 
+  Null visitLibrary(ir.Library node) {
+    for (String path in analyzedPaths) {
+      if ('${node.importUri}'.startsWith(path)) {
+        return super.visitLibrary(node);
+      }
+    }
+  }
+
   @override
   ir.DartType visitPropertyGet(ir.PropertyGet node) {
     ir.DartType result = super.visitPropertyGet(node);
diff --git a/tests/compiler/dart2js/analyses/api_dynamic_test.dart b/tests/compiler/dart2js/analyses/api_dynamic_test.dart
index 86d423f..bb1564a 100644
--- a/tests/compiler/dart2js/analyses/api_dynamic_test.dart
+++ b/tests/compiler/dart2js/analyses/api_dynamic_test.dart
@@ -10,7 +10,7 @@
 main(List<String> args) {
   asyncTest(() async {
     await run(Uri.parse('memory:main.dart'),
-        'tests/compiler/dart2js/analyses/api_allowed.json',
+        'tests/compiler/dart2js/analyses/api_allowed.json', ['dart:'],
         memorySourceFiles: {'main.dart': 'main() {}'},
         verbose: args.contains('-v'),
         generate: args.contains('-g'));
diff --git a/tests/compiler/dart2js/analyses/dart2js_allowed.json b/tests/compiler/dart2js/analyses/dart2js_allowed.json
index 016ac0e..67d29a0 100644
--- a/tests/compiler/dart2js/analyses/dart2js_allowed.json
+++ b/tests/compiler/dart2js/analyses/dart2js_allowed.json
@@ -16,14 +16,6 @@
     "Dynamic invocation of 'writeCharCode'.": 1,
     "Dynamic invocation of '=='.": 1
   },
-  "pkg/kernel/lib/kernel.dart": {
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic invocation of 'flush'.": 1,
-    "Dynamic invocation of 'close'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/util/link.dart": {
-    "Dynamic access of 'isEmpty'.": 1
-  },
   "pkg/compiler/lib/src/util/maplet.dart": {
     "Dynamic access of 'isEmpty'.": 1,
     "Dynamic invocation of '=='.": 9,
@@ -58,38 +50,6 @@
     "Dynamic invocation of 'toSet'.": 1,
     "Dynamic invocation of 'toList'.": 1
   },
-  "pkg/kernel/lib/ast.dart": {
-    "Dynamic update to 'parent'.": 1,
-    "Dynamic invocation of '=='.": 2
-  },
-  "pkg/kernel/lib/text/ast_to_text.dart": {
-    "Dynamic invocation of '+'.": 3
-  },
-  "pkg/front_end/lib/src/base/libraries_specification.dart": {
-    "Dynamic invocation of 'containsKey'.": 1,
-    "Dynamic invocation of '[]'.": 11,
-    "Dynamic invocation of 'map'.": 2,
-    "Dynamic invocation of 'toList'.": 1,
-    "Dynamic access of 'runtimeType'.": 1,
-    "Dynamic invocation of 'forEach'.": 2,
-    "Dynamic invocation of '[]='.": 1
-  },
-  "pkg/front_end/lib/src/fasta/scanner/token.dart": {
-    "Dynamic access of 'data'.": 1,
-    "Dynamic access of 'start'.": 1,
-    "Dynamic access of 'length'.": 1,
-    "Dynamic access of 'boolValue'.": 2
-  },
-  "pkg/front_end/lib/src/fasta/colors.dart": {
-    "Dynamic access of 'supportsAnsiEscapes'.": 1,
-    "Dynamic invocation of 'split'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/crash.dart": {
-    "Dynamic access of 'trace'.": 1,
-    "Dynamic access of 'uri'.": 1,
-    "Dynamic access of 'charOffset'.": 1,
-    "Dynamic access of 'error'.": 1
-  },
   "pkg/compiler/lib/src/common/tasks.dart": {
     "Dynamic invocation of '=='.": 4
   },
@@ -102,34 +62,6 @@
     "Dynamic access of 'lexeme'.": 1,
     "Dynamic invocation of 'toDartText'.": 1
   },
-  "pkg/front_end/lib/src/fasta/util/link_implementation.dart": {
-    "Dynamic access of 'isNotEmpty'.": 1,
-    "Dynamic access of 'head'.": 1,
-    "Dynamic access of 'tail'.": 1,
-    "Dynamic access of 'isEmpty'.": 1
-  },
-  "pkg/kernel/lib/import_table.dart": {
-    "Dynamic access of 'scheme'.": 6,
-    "Dynamic invocation of '=='.": 3
-  },
-  "third_party/pkg/source_span/lib/src/file.dart": {
-    "Dynamic access of 'sourceUrl'.": 2,
-    "Dynamic access of '#lib1::_start'.": 1,
-    "Dynamic access of '#lib1::_end'.": 1
-  },
-  "third_party/pkg/source_span/lib/src/span_mixin.dart": {
-    "Dynamic invocation of '=='.": 2
-  },
-  "pkg/front_end/lib/src/fasta/scanner/string_canonicalizer.dart": {
-    "Dynamic invocation of '[]'.": 3,
-    "Dynamic invocation of '=='.": 1
-  },
-  "pkg/front_end/lib/src/fasta/dill/dill_member_builder.dart": {
-    "Dynamic access of 'fileUri'.": 1
-  },
-  "pkg/kernel/lib/clone.dart": {
-    "Dynamic update to 'fileOffset'.": 1
-  },
   "pkg/compiler/lib/src/diagnostics/source_span.dart": {
     "Dynamic access of 'uri'.": 1,
     "Dynamic access of 'begin'.": 1,
@@ -239,40 +171,6 @@
     "Dynamic access of 'kind'.": 1,
     "Dynamic access of 'hashCode'.": 1
   },
-  "pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart": {
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic access of 'name'.": 2,
-    "Dynamic access of 'length'.": 2,
-    "Dynamic access of 'enclosingClass'.": 4,
-    "Dynamic access of 'typeParameters'.": 2
-  },
-  "pkg/front_end/lib/src/fasta/kernel/kernel_function_type_alias_builder.dart": {
-    "Dynamic access of 'fileUri'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/kernel/kernel_function_type_builder.dart": {
-    "Dynamic invocation of 'clone'.": 2
-  },
-  "pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart": {
-    "Dynamic access of 'reference'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/kernel/kernel_procedure_builder.dart": {
-    "Dynamic access of 'typeParameters'.": 1,
-    "Dynamic invocation of 'addAnnotation'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/kernel/body_builder.dart": {
-    "Dynamic access of 'fileOffset'.": 1,
-    "Dynamic access of 'runtimeType'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/source/diet_listener.dart": {
-    "Dynamic access of 'thisType'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/source/outline_builder.dart": {
-    "Dynamic invocation of 'withArguments'.": 1,
-    "Dynamic update to 'bound'.": 1
-  },
-  "pkg/front_end/lib/src/fasta/builder/function_type_builder.dart": {
-    "Dynamic access of 'fullNameForErrors'.": 1
-  },
   "pkg/compiler/lib/src/helpers/trace.dart": {
     "Dynamic access of 'index'.": 1,
     "Dynamic access of 'file'.": 1,
@@ -447,10 +345,6 @@
     "Dynamic access of 'thisConstructorInvocation'.": 1,
     "Dynamic access of 'targetConstructorInvocation'.": 1
   },
-  "pkg/front_end/lib/src/fasta/kernel/expression_generator.dart": {
-    "Dynamic access of 'hasGetter'.": 1,
-    "Dynamic access of 'hasSetter'.": 2
-  },
   "pkg/compiler/lib/src/ssa/optimize.dart": {
     "Dynamic access of 'isEmpty'.": 1,
     "Dynamic invocation of 'replaceWith'.": 1,
@@ -599,376 +493,5 @@
   "pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart": {
     "Dynamic access of 'superclass'.": 1,
     "Dynamic access of 'needsTearOff'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/interceptors.dart": {
-    "Dynamic invocation of 'toString'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/js_number.dart": {
-    "Dynamic invocation of '[]'.": 5,
-    "Dynamic invocation of '<'.": 4,
-    "Dynamic invocation of '>='.": 1,
-    "Dynamic invocation of '<='.": 1,
-    "Dynamic invocation of '>'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/js_helper.dart": {
-    "Dynamic invocation of '[]'.": 3,
-    "Dynamic access of 'isNaN'.": 3,
-    "Dynamic invocation of '<='.": 4,
-    "Dynamic invocation of '-'.": 7,
-    "Dynamic invocation of '>>'.": 3,
-    "Dynamic invocation of '&'.": 3,
-    "Dynamic invocation of '<'.": 6,
-    "Dynamic invocation of '>'.": 4,
-    "Dynamic invocation of '+'.": 1,
-    "Dynamic invocation of 'noSuchMethod'.": 1,
-    "Dynamic access of '_js_helper::_self'.": 1,
-    "Dynamic access of '_js_helper::_target'.": 1,
-    "Dynamic access of '_js_helper::_receiver'.": 1,
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic access of 'hashCode'.": 2,
-    "Dynamic invocation of 'toString'.": 2,
-    "Dynamic access of 'length'.": 3,
-    "Dynamic invocation of '>='.": 1,
-    "Dynamic invocation of 'substring'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/constant_map.dart": {
-    "Dynamic invocation of '=='.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/string_helper.dart": {
-    "Dynamic invocation of '<'.": 1,
-    "Dynamic invocation of '+'.": 1,
-    "Dynamic invocation of '>='.": 1,
-    "Dynamic invocation of 'substring'.": 7,
-    "Dynamic invocation of 'allMatches'.": 7,
-    "Dynamic access of 'isNotEmpty'.": 1,
-    "Dynamic invocation of '_js_helper::_execGlobal'.": 1,
-    "Dynamic access of 'start'.": 1,
-    "Dynamic access of 'end'.": 1,
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic access of 'length'.": 4,
-    "Dynamic invocation of '[]'.": 2,
-    "Dynamic invocation of 'call'.": 13,
-    "Dynamic invocation of 'codeUnitAt'.": 2,
-    "Dynamic access of 'iterator'.": 2,
-    "Dynamic invocation of 'replaceRange'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/linked_hash_map.dart": {
-    "Dynamic access of 'hashCode'.": 1,
-    "Dynamic invocation of '=='.": 2,
-    "Dynamic access of '_js_helper::_length'.": 3,
-    "Dynamic access of '_js_helper::_modifications'.": 4,
-    "Dynamic invocation of 'containsKey'.": 1,
-    "Dynamic access of '_js_helper::_first'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/js_rti.dart": {
-    "Dynamic invocation of '<'.": 1,
-    "Dynamic invocation of '-'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/native_helper.dart": {
-    "Dynamic invocation of '=='.": 6,
-    "Dynamic access of 'length'.": 2,
-    "Dynamic invocation of '[]'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/regexp_helper.dart": {
-    "Dynamic access of 'length'.": 2,
-    "Dynamic invocation of '-'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/native_typed_data.dart": {
-    "Dynamic invocation of '>'.": 1,
-    "Dynamic invocation of '|'.": 7,
-    "Dynamic invocation of '>='.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/async_patch.dart": {
-    "Dynamic invocation of '-'.": 1,
-    "Dynamic access of 'iterator'.": 1,
-    "Dynamic invocation of 'call'.": 4,
-    "Dynamic invocation of 'then'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/async/future.dart": {
-    "Dynamic invocation of 'call'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/async/stream.dart": {
-    "Dynamic invocation of 'dart.async::_addError'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/async/async_error.dart": {
-    "Dynamic invocation of 'call'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/collection_patch.dart": {
-    "Dynamic access of 'hashCode'.": 3,
-    "Dynamic invocation of '=='.": 4,
-    "Dynamic access of 'dart.collection::_length'.": 3,
-    "Dynamic invocation of 'dart.collection::_computeKeys'.": 2,
-    "Dynamic invocation of 'containsKey'.": 2,
-    "Dynamic access of 'dart.collection::_keys'.": 2,
-    "Dynamic access of 'length'.": 1,
-    "Dynamic access of 'isEmpty'.": 1,
-    "Dynamic access of 'dart.collection::_modifications'.": 5,
-    "Dynamic access of 'dart.collection::_map'.": 4,
-    "Dynamic access of 'dart.collection::_elements'.": 1,
-    "Dynamic access of 'dart.collection::_element'.": 1,
-    "Dynamic access of 'dart.collection::_first'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/collection/splay_tree.dart": {
-    "Dynamic invocation of '=='.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/collection/hash_map.dart": {
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic access of 'hashCode'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/collection/iterable.dart": {
-    "Dynamic access of 'length'.": 4,
-    "Dynamic invocation of '+'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/html/dart2js/html_dart2js.dart": {
-    "Dynamic access of 'style'.": 1,
-    "Dynamic invocation of '=='.": 4,
-    "Dynamic access of 'left'.": 3,
-    "Dynamic access of 'top'.": 3,
-    "Dynamic access of 'width'.": 2,
-    "Dynamic access of 'height'.": 2,
-    "Dynamic invocation of 'remove'.": 2,
-    "Dynamic update to 'dart.dom.html::_innerHtml'.": 1,
-    "Dynamic access of 'firstChild'.": 2,
-    "Dynamic invocation of 'append'.": 1,
-    "Dynamic access of 'tagName'.": 2,
-    "Dynamic invocation of 'round'.": 20,
-    "Dynamic invocation of 'toList'.": 1,
-    "Dynamic access of 'right'.": 1,
-    "Dynamic access of 'bottom'.": 1,
-    "Dynamic invocation of 'call'.": 1,
-    "Dynamic invocation of 'dart.dom.html::_initKeyboardEvent'.": 1,
-    "Dynamic access of 'attributes'.": 1,
-    "Dynamic invocation of '[]'.": 1,
-    "Dynamic invocation of 'toString'.": 1,
-    "Dynamic invocation of 'toLowerCase'.": 1,
-    "Dynamic invocation of 'attached'.": 1,
-    "Dynamic invocation of 'detached'.": 1,
-    "Dynamic invocation of 'attributeChanged'.": 1,
-    "Dynamic invocation of 'createElement'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/html/html_common/conversions.dart": {
-    "Dynamic invocation of '[]='.": 2,
-    "Dynamic access of 'length'.": 1,
-    "Dynamic invocation of '[]'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/html/html_common/filtered_element_list.dart": {
-    "Dynamic invocation of 'remove'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/html/html_common/lists.dart": {
-    "Dynamic invocation of '=='.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart": {
-    "Dynamic access of 'onUpgradeNeeded'.": 2,
-    "Dynamic invocation of 'listen'.": 2,
-    "Dynamic access of 'onBlocked'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/io/directory_impl.dart": {
-    "Dynamic invocation of '=='.": 5,
-    "Dynamic invocation of '[]'.": 11
-  },
-  "org-dartlang-sdk:///sdk/lib/io/file_impl.dart": {
-    "Dynamic invocation of 'cancel'.": 2,
-    "Dynamic invocation of 'pause'.": 2,
-    "Dynamic invocation of 'resume'.": 2,
-    "Dynamic invocation of '=='.": 2,
-    "Dynamic invocation of '[]'.": 5,
-    "Dynamic access of 'length'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/io/file_system_entity.dart": {
-    "Dynamic invocation of '[]'.": 7
-  },
-  "org-dartlang-sdk:///sdk/lib/io/io_resource_info.dart": {
-    "Dynamic invocation of '=='.": 2,
-    "Dynamic invocation of 'containsKey'.": 1,
-    "Dynamic invocation of '[]'.": 1,
-    "Dynamic access of 'path'.": 1,
-    "Dynamic access of 'dart.io::_path'.": 1,
-    "Dynamic access of 'pid'.": 1,
-    "Dynamic access of 'dart.io::_arguments'.": 1,
-    "Dynamic access of 'dart.io::_workingDirectory'.": 2,
-    "Dynamic access of 'isListening'.": 3,
-    "Dynamic access of 'address'.": 10,
-    "Dynamic access of 'host'.": 5,
-    "Dynamic access of 'port'.": 3,
-    "Dynamic access of 'remoteAddress'.": 4,
-    "Dynamic access of 'remotePort'.": 2,
-    "Dynamic access of 'isTcp'.": 1,
-    "Dynamic access of 'type'.": 2,
-    "Dynamic access of 'name'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/io/link.dart": {
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic invocation of '[]'.": 3
-  },
-  "org-dartlang-sdk:///sdk/lib/io/platform_impl.dart": {
-    "Dynamic invocation of 'indexOf'.": 1,
-    "Dynamic invocation of '>'.": 1,
-    "Dynamic invocation of 'substring'.": 2,
-    "Dynamic invocation of '+'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/io/secure_server_socket.dart": {
-    "Dynamic update to 'dart.io::_owner'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/io/secure_socket.dart": {
-    "Dynamic invocation of 'dart.io::_detachRaw'.": 8,
-    "Dynamic invocation of '[]'.": 14,
-    "Dynamic access of 'dart.io::_socket'.": 2,
-    "Dynamic access of 'closedReadEventSent'.": 1,
-    "Dynamic access of 'host'.": 1,
-    "Dynamic update to 'dart.io::_owner'.": 1,
-    "Dynamic access of 'length'.": 2,
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic invocation of '~/'.": 1,
-    "Dynamic invocation of '+'.": 6,
-    "Dynamic invocation of '-'.": 9
-  },
-  "org-dartlang-sdk:///sdk/lib/io/stdio.dart": {
-    "Dynamic invocation of 'writeFromSync'.": 1,
-    "Dynamic invocation of 'cancel'.": 1,
-    "Dynamic invocation of 'closeSync'.": 1,
-    "Dynamic access of 'dart.io::_stream'.": 1,
-    "Dynamic invocation of '=='.": 3
-  },
-  "org-dartlang-sdk:///sdk/lib/io/common.dart": {
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic invocation of '[]'.": 3
-  },
-  "org-dartlang-sdk:///sdk/lib/js/dart2js/js_dart2js.dart": {
-    "Dynamic invocation of '[]'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/svg/dart2js/svg_dart2js.dart": {
-    "Dynamic invocation of 'createFragment'.": 1,
-    "Dynamic access of 'nodes'.": 4,
-    "Dynamic invocation of 'where'.": 2,
-    "Dynamic access of 'single'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/core_patch.dart": {
-    "Dynamic access of 'dart.core::_digits'.": 2,
-    "Dynamic invocation of '<'.": 2,
-    "Dynamic invocation of '+'.": 2,
-    "Dynamic invocation of '[]'.": 47,
-    "Dynamic invocation of 'dart.core::_absSubSetSign'.": 3,
-    "Dynamic invocation of 'dart.core::_absAndNotSetSign'.": 3,
-    "Dynamic invocation of 'dart.core::_absAddSetSign'.": 2,
-    "Dynamic invocation of 'dart.core::_absXorSetSign'.": 2,
-    "Dynamic invocation of '[]='.": 2,
-    "Dynamic invocation of '&'.": 12,
-    "Dynamic invocation of '=='.": 16,
-    "Dynamic invocation of '-'.": 2,
-    "Dynamic invocation of '>='.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/core/date_time.dart": {
-    "Dynamic access of 'dart.core::_value'.": 1,
-    "Dynamic access of 'isUtc'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/core/duration.dart": {
-    "Dynamic access of 'dart.core::_duration'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/core/errors.dart": {
-    "Dynamic access of 'length'.": 2,
-    "Dynamic invocation of '<'.": 2,
-    "Dynamic invocation of '~'.": 1,
-    "Dynamic invocation of '^'.": 1,
-    "Dynamic invocation of '&'.": 1,
-    "Dynamic invocation of '|'.": 1,
-    "Dynamic invocation of '>>'.": 1,
-    "Dynamic invocation of '<<'.": 1,
-    "Dynamic invocation of '+'.": 1,
-    "Dynamic invocation of 'unary-'.": 1,
-    "Dynamic invocation of '-'.": 1,
-    "Dynamic invocation of '*'.": 1,
-    "Dynamic invocation of '/'.": 1,
-    "Dynamic invocation of '~/'.": 1,
-    "Dynamic invocation of '>'.": 1,
-    "Dynamic invocation of '>='.": 1,
-    "Dynamic invocation of '<='.": 1,
-    "Dynamic invocation of '%'.": 1,
-    "Dynamic invocation of 'length'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/core/exceptions.dart": {
-    "Dynamic access of 'length'.": 3,
-    "Dynamic invocation of 'codeUnitAt'.": 2,
-    "Dynamic invocation of 'substring'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/core/uri.dart": {
-    "Dynamic access of 'isEmpty'.": 1,
-    "Dynamic invocation of 'startsWith'.": 1,
-    "Dynamic invocation of 'add'.": 1,
-    "Dynamic invocation of '=='.": 8
-  },
-  "org-dartlang-sdk:///sdk/lib/math/point.dart": {
-    "Dynamic access of 'x'.": 1,
-    "Dynamic access of 'y'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/math/rectangle.dart": {
-    "Dynamic access of 'left'.": 1,
-    "Dynamic access of 'top'.": 1,
-    "Dynamic access of 'right'.": 1,
-    "Dynamic access of 'bottom'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/convert_patch.dart": {
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic invocation of 'clear'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/convert/encoding.dart": {
-    "Dynamic invocation of 'write'.": 2,
-    "Dynamic invocation of 'toString'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/convert/string_conversion.dart": {
-    "Dynamic invocation of 'toString'.": 3
-  },
-  "org-dartlang-sdk:///sdk/lib/convert/json.dart": {
-    "Dynamic invocation of 'toJson'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/isolate/isolate.dart": {
-    "Dynamic invocation of '[]'.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/_http/crypto.dart": {
-    "Dynamic invocation of '+'.": 6,
-    "Dynamic invocation of '&'.": 3,
-    "Dynamic invocation of '-'.": 3,
-    "Dynamic invocation of 'unary-'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_http/http_date.dart": {
-    "Dynamic access of 'length'.": 6,
-    "Dynamic invocation of '<'.": 1,
-    "Dynamic invocation of '>='.": 2,
-    "Dynamic invocation of '[]'.": 9,
-    "Dynamic invocation of '=='.": 2
-  },
-  "org-dartlang-sdk:///sdk/lib/_http/http_headers.dart": {
-    "Dynamic invocation of '=='.": 3,
-    "Dynamic invocation of 'toLowerCase'.": 1,
-    "Dynamic access of 'length'.": 1,
-    "Dynamic invocation of 'codeUnitAt'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_http/http_impl.dart": {
-    "Dynamic access of 'message'.": 4,
-    "Dynamic invocation of 'split'.": 2,
-    "Dynamic invocation of 'trim'.": 4,
-    "Dynamic invocation of 'toLowerCase'.": 2,
-    "Dynamic invocation of '=='.": 1,
-    "Dynamic invocation of 'call'.": 1,
-    "Dynamic invocation of 'destroy'.": 2,
-    "Dynamic invocation of 'setOption'.": 1,
-    "Dynamic access of 'address'.": 3,
-    "Dynamic access of 'host'.": 2,
-    "Dynamic access of 'port'.": 2,
-    "Dynamic access of 'remoteAddress'.": 2,
-    "Dynamic access of 'remotePort'.": 1,
-    "Dynamic invocation of 'dart._http::_toJSON'.": 3,
-    "Dynamic invocation of 'listen'.": 1,
-    "Dynamic invocation of 'close'.": 1
-  },
-  "org-dartlang-sdk:///sdk/lib/_http/http_parser.dart": {
-    "Dynamic invocation of '=='.": 4
-  },
-  "org-dartlang-sdk:///sdk/lib/_http/websocket_impl.dart": {
-    "Dynamic invocation of 'transform'.": 2,
-    "Dynamic invocation of 'listen'.": 1,
-    "Dynamic access of 'address'.": 2,
-    "Dynamic access of 'host'.": 1,
-    "Dynamic access of 'port'.": 1,
-    "Dynamic invocation of 'dart._http::_toJSON'.": 1
   }
 }
\ No newline at end of file
diff --git a/tests/compiler/dart2js/analyses/dart2js_dynamic_test.dart b/tests/compiler/dart2js/analyses/dart2js_dynamic_test.dart
index 1b27ae7..43ba39a 100644
--- a/tests/compiler/dart2js/analyses/dart2js_dynamic_test.dart
+++ b/tests/compiler/dart2js/analyses/dart2js_dynamic_test.dart
@@ -9,8 +9,16 @@
 // code.
 main(List<String> args) {
   asyncTest(() async {
-    await run(Uri.parse('package:compiler/src/dart2js.dart'),
+    await run(
+        Uri.parse('package:compiler/src/dart2js.dart'),
         'tests/compiler/dart2js/analyses/dart2js_allowed.json',
-        verbose: args.contains('-v'), generate: args.contains('-g'));
+        [
+          'package:compiler/',
+          'package:js_ast/',
+          'package:dart2js_info/',
+          'package:js_runtime/'
+        ],
+        verbose: args.contains('-v'),
+        generate: args.contains('-g'));
   });
 }