Add a packageResolver parameter to runInIsolate().

This isn't used by test proper, but it's needed by some
Google-internal code.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org//2269403002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b76bfc4..d8b12bf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.12.15+5
+
+* Internal-only change.
+
 ## 0.12.15+4
 
 * Widen version constraint on `analyzer`.
diff --git a/lib/src/util/dart.dart b/lib/src/util/dart.dart
index 05cd260..e18b50d 100644
--- a/lib/src/util/dart.dart
+++ b/lib/src/util/dart.dart
@@ -6,6 +6,7 @@
 import 'dart:isolate';
 
 import 'package:analyzer/analyzer.dart';
+import 'package:package_resolver/package_resolver.dart';
 import 'package:source_span/source_span.dart';
 
 import 'string_literal_iterator.dart';
@@ -16,13 +17,18 @@
 /// they will be resolved in the same context as the host isolate. [message] is
 /// passed to the [main] method of the code being run; the caller is responsible
 /// for using this to establish communication with the isolate.
-Future<Isolate> runInIsolate(String code, message, {bool checked}) async {
+///
+/// If [resolver] is passed, its package resolution strategy is used to resolve
+/// code in the spawned isolate. It defaults to [PackageResolver.current].
+Future<Isolate> runInIsolate(String code, message, {PackageResolver resolver,
+    bool checked}) async {
+  resolver ??= PackageResolver.current;
   return await Isolate.spawnUri(
       Uri.parse('data:application/dart;charset=utf-8,' + Uri.encodeFull(code)),
       [],
       message,
-      packageRoot: await Isolate.packageRoot,
-      packageConfig: await Isolate.packageConfig,
+      packageRoot: await resolver.packageRoot,
+      packageConfig: await resolver.packageConfigUri,
       checked: checked);
 }
 
diff --git a/pubspec.yaml b/pubspec.yaml
index ffba7da..6ac0f92 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: test
-version: 0.12.15+4
+version: 0.12.15+5
 author: Dart Team <misc@dartlang.org>
 description: A library for writing dart unit tests.
 homepage: https://github.com/dart-lang/test