Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index e98f6f1386b3cf1938fe5cc5a4efd5510d807768..2d2735970ff9a1f1d36c0b1e40ef0d6baf43fc18 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -712,6 +712,7 @@ class StandardTestSuite extends TestSuite { |
| enqueueStandardTest(info, testName, expectations); |
| } else if (TestUtils.isBrowserRuntime(configuration['runtime'])) { |
| bool isWrappingRequired = configuration['compiler'] != 'dart2js'; |
| + |
| if (info.optionsFromFile['isMultiHtmlTest']) { |
| // A browser multi-test has multiple expectations for one test file. |
| // Find all the different sub-test expecations for one entire test file. |
| @@ -917,14 +918,23 @@ class StandardTestSuite extends TestSuite { |
| return url; |
| } |
| - void _createWrapperFile(String dartWrapperFilename, dartLibraryFilename) { |
| + void _createWrapperFile(String dartWrapperFilename, |
| + dartLibraryFilename, |
|
kasperl
2013/10/01 13:15:55
Add a type annotation for this?
kustermann
2013/10/01 15:41:59
Done.
|
| + {bool useUnittestWrapper: false}) { |
| File file = new File(dartWrapperFilename); |
| RandomAccessFile dartWrapper = file.openSync(mode: FileMode.WRITE); |
| var usePackageImport = dartLibraryFilename.segments().contains("pkg"); |
| var libraryPathComponent = _createUrlPathFromFile(dartLibraryFilename); |
| - dartWrapper.writeStringSync(dartTestWrapper(usePackageImport, |
| - libraryPathComponent)); |
| + var generatedSource; |
| + if (useUnittestWrapper) { |
| + generatedSource = dartUnittestWrapper(usePackageImport, |
| + libraryPathComponent); |
| + } else { |
| + generatedSource = dartTestWrapper(libraryPathComponent); |
| + } |
| + |
| + dartWrapper.writeStringSync(generatedSource); |
| dartWrapper.closeSync(); |
| } |
| @@ -987,7 +997,6 @@ class StandardTestSuite extends TestSuite { |
| // Use existing HTML document if available. |
| String htmlPath; |
| if (customHtml.existsSync()) { |
| - |
| // If necessary, run the Polymer deploy steps. |
| // TODO(jmesserly): this should be generalized for any tests that |
| // require Pub deploy, not just polymer. |
| @@ -1027,8 +1036,16 @@ class StandardTestSuite extends TestSuite { |
| } else { |
| htmlPath = '$tempDir/test.html'; |
| if (isWrappingRequired && !isWebTest) { |
| - // test.dart will import the dart test. |
| - _createWrapperFile(dartWrapperFilename, filePath); |
| + if (configuration['use_browser_controller'] && |
| + configuration['runtime'] == 'dartium') { |
| + _createWrapperFile(dartWrapperFilename, filePath); |
| + } else { |
| + // FIXME(kustermann): This is broken, we can't wrap tests in |
|
kasperl
2013/10/01 13:15:55
Maybe move this FIXME comment to the implementatio
kustermann
2013/10/01 15:41:59
Done.
|
| + // unittest. |
| + // test.dart will import the dart test. |
| + _createWrapperFile( |
| + dartWrapperFilename, filePath, useUnittestWrapper: true); |
| + } |
| } else { |
| dartWrapperFilename = filename; |
| } |