Add a hacky hook to override the loader behavior.

This is specifically to allow Sky to get sky_shell support into the test
runner immediately. It's temporary; it'll last until we land proper
plugin support.

See #320

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//1309493002 .
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf23733..b54ca9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.12.4+5
+
+* Internal changes only.
+
 ## 0.12.4+4
 
 * Widen the Dart SDK constraint to include `1.13.0`.
diff --git a/lib/src/runner/hack_load_vm_file_hook.dart b/lib/src/runner/hack_load_vm_file_hook.dart
new file mode 100644
index 0000000..4043257
--- /dev/null
+++ b/lib/src/runner/hack_load_vm_file_hook.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.runner.hack_load_vm_file_hook;
+
+import 'dart:async';
+
+import '../backend/metadata.dart';
+import 'configuration.dart';
+import 'runner_suite.dart';
+
+typedef Future<RunnerSuite> LoadVMFileHook(String path, Metadata metadata,
+    Configuration config);
+
+/// **Do not set or use this function without express permission from the test
+/// package authors**.
+///
+/// A function that overrides the loader's default behavior for loading test
+/// suites on the Dart VM. This function takes the path to the file, the
+/// file's metadata, and the test runner's configuration and returns a
+/// [RunnerSuite] for that file.
+LoadVMFileHook loadVMFileHook;
diff --git a/lib/src/runner/loader.dart b/lib/src/runner/loader.dart
index 68f94d6..abf22b9 100644
--- a/lib/src/runner/loader.dart
+++ b/lib/src/runner/loader.dart
@@ -20,8 +20,9 @@
 import '../util/io.dart';
 import '../util/remote_exception.dart';
 import '../utils.dart';
-import 'configuration.dart';
 import 'browser/server.dart';
+import 'configuration.dart';
+import 'hack_load_vm_file_hook.dart';
 import 'load_exception.dart';
 import 'load_suite.dart';
 import 'parse_metadata.dart';
@@ -144,6 +145,12 @@
   ///
   /// [metadata] is the suite-level metadata for the test.
   Future<RunnerSuite> _loadVmFile(String path, Metadata metadata) async {
+    if (loadVMFileHook != null) {
+      var suite = await loadVMFileHook(path, metadata, _config);
+      _suites.add(suite);
+      return suite;
+    }
+
     var receivePort = new ReceivePort();
 
     var isolate;
diff --git a/pubspec.yaml b/pubspec.yaml
index 3f7cfb2..c9c1f98 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
 name: test
-version: 0.12.4+4
+version: 0.12.4+5
 author: Dart Team <misc@dartlang.org>
 description: A library for writing dart unit tests.
 homepage: https://github.com/dart-lang/test