Index: tools/testing/dart/browser_test.dart |
diff --git a/tools/testing/dart/browser_test.dart b/tools/testing/dart/browser_test.dart |
index 862375d87227a878bfbe1774b83823cd1a9b6ab5..b547e12d8196a64977e7246f51bb152b51520cdc 100644 |
--- a/tools/testing/dart/browser_test.dart |
+++ b/tools/testing/dart/browser_test.dart |
@@ -2,6 +2,8 @@ |
// 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. |
+import 'utils.dart'; |
+ |
String getHtmlContents(String title, String scriptType, String scriptPath) { |
return """ |
<!DOCTYPE html> |
@@ -38,7 +40,13 @@ String getHtmlContents(String title, String scriptType, String scriptPath) { |
/// The [testName] is the short name of the test without any subdirectory path |
/// or extension, like "math_test". The [testJSDir] is the relative path to the |
/// build directory where the dartdevc-generated JS file is stored. |
-String dartdevcHtml(String testName, String testJSDir) => """ |
+String dartdevcHtml(String testName, String testJSDir, String buildDir) { |
+ var packagePaths = testPackages |
+ .map((package) => ' "$package": "/root_dart/$buildDir/gen/dartdevc/' |
+ 'pkg/$package",') |
+ .join("\n"); |
+ |
+ return """ |
<!DOCTYPE html> |
<html> |
<head> |
@@ -64,6 +72,7 @@ var require = { |
// are being built. Right now, they are compiled into the test module itself. |
paths: { |
"dart_sdk": "/root_dart/pkg/dev_compiler/lib/js/amd/dart_sdk", |
+$packagePaths |
} |
}; |
@@ -75,8 +84,17 @@ window.ddcSettings = { |
<script type="text/javascript" |
src="/root_dart/third_party/requirejs/require.js"></script> |
<script type="text/javascript"> |
-requirejs(["$testName", "dart_sdk"], |
- function($testName, dart_sdk) { |
+requirejs(["$testName", "dart_sdk", "async_helper"], |
+ function($testName, dart_sdk, async_helper) { |
+ function finish() { |
+ // dev_compiler's test runner (language_test.js) uses this to notify the |
+ // test results, but it isn't needed for test.dart. |
+ } |
+ |
+ // TODO(rnystrom): This uses DDC's forked version of async_helper. Unfork |
+ // these packages when possible. |
+ async_helper.async_helper.asyncTestInitialize(finish); |
+ |
dart_sdk._isolate_helper.startRootIsolate(function() {}, []); |
dartMainRunner($testName.$testName.main); |
}); |
@@ -84,6 +102,7 @@ requirejs(["$testName", "dart_sdk"], |
</body> |
</html> |
"""; |
+} |
String dartTestWrapper(String libraryPathComponent) { |
return """ |