| Index: tools/testing/dart/browser_test.dart
|
| diff --git a/tools/testing/dart/browser_test.dart b/tools/testing/dart/browser_test.dart
|
| index 0694db3f68f07c4c5bbbe1bc3a4276df21a1d252..619b8c70fc5fbca4f9a8dad843d6b2e1c5695c1f 100644
|
| --- a/tools/testing/dart/browser_test.dart
|
| +++ b/tools/testing/dart/browser_test.dart
|
| @@ -54,12 +54,19 @@ library libraryWrapper;
|
| part '$test';
|
| """;
|
|
|
| -String dartTestWrapper(Path dartHome, Path library) =>
|
| -"""
|
| +String dartTestWrapper(Path dartHome, Path library) {
|
| + // Tests inside "pkg" import unittest using "package:". All others use a
|
| + // relative path. The imports need to agree, so use a matching form here.
|
| + var unitTest = dartHome.append("pkg/unittest/lib").toString();
|
| + if (library.relativeTo(dartHome).segments().contains("pkg")) {
|
| + unitTest = 'package:unittest';
|
| + }
|
| +
|
| + return """
|
| library test;
|
|
|
| -import '${dartHome.append('pkg/unittest/lib/unittest.dart')}' as unittest;
|
| -import '${dartHome.append('pkg/unittest/lib/html_config.dart')}' as config;
|
| +import '$unitTest/unittest.dart' as unittest;
|
| +import '$unitTest/html_config.dart' as config;
|
| import '${library}' as Test;
|
|
|
| main() {
|
| @@ -67,4 +74,4 @@ main() {
|
| unittest.group('', Test.main);
|
| }
|
| """;
|
| -
|
| +}
|
|
|