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 dae353a5c3773b8fe2136795fd6826df18cecb5e..5759081c690ce9b6e31703ef22da23eaa262c84c 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -1171,16 +1171,47 @@ class StandardTestSuite extends TestSuite { |
| // rewriting of script links in html file. Currently unimplemented. |
| return; |
| } |
| + final String tempDir = createOutputDirectory(info.filePath, ''); |
| + final Uri tempUri = new Uri.file('$tempDir/'); |
| + final Uri htmlFile = tempUri.resolve(filePath.filename); |
| + new File.fromUri(htmlFile).writeAsStringSync(htmlTest.getContents(info)); |
| if (info.scripts.length > 0) { |
| - // TODO(whesse): Copy scripts into output directory. |
| - return; |
| + Uri testUri = new Uri.file(filePath.toNativePath()); |
| + for (String scriptPath in info.scripts) { |
| + if (!scriptPath.endsWith('.dart') && !scriptPath.endsWith('.js')) { |
| + DebugLogger.warning('HTML test scripts must be dart or javascript: ' |
|
ricow1
2014/11/05 10:59:54
fail the test?
Bill Hesse
2014/11/05 12:51:51
Done.
|
| + '${info.filePath}'); |
| + return; |
| + |
| + } |
| + Uri uri = Uri.parse(scriptPath); |
| + if (uri.isAbsolute) { |
| + DebugLogger.warning('HTML test scripts must have relative paths: ' |
|
ricow1
2014/11/05 10:59:55
fail the test?
Bill Hesse
2014/11/05 12:51:51
Done.
|
| + '${info.filePath}'); |
| + return; |
| + } |
| + if (uri.pathSegments.length > 1) { |
| + DebugLogger.warning('HTML test scripts must be in test directory: ' |
|
ricow1
2014/11/05 10:59:55
fail the test?
Bill Hesse
2014/11/05 12:51:51
Done.
|
| + '${info.filePath}'); |
| + return; |
| + } |
| + Uri script = testUri.resolveUri(uri); |
| + if (compiler == 'none') { |
| + Uri copiedScript = tempUri.resolveUri(uri); |
| + new File.fromUri(copiedScript).writeAsStringSync( |
| + new File.fromUri(script).readAsStringSync()); |
| + } else { |
| + // TODO(whesse): Compile scripts into output directory. |
| + DebugLogger.error('HTML test scripts don\'t support dart2js yet: ' |
|
ricow1
2014/11/05 10:59:55
so can you even land this?
Bill Hesse
2014/11/05 12:51:51
line 1169 skipped all platforms without compiler =
|
| + '${info.filePath}'); |
| + exit(1); |
| + } |
| + } |
| } |
| - final String tempDir = createOutputDirectory(info.filePath, ''); |
| - final String htmlFile = '$tempDir/${filePath.filename}'; |
| - new File(htmlFile).writeAsStringSync(htmlTest.getContents(info)); |
| + new File.fromUri(htmlFile).writeAsStringSync(htmlTest.getContents(info)); |
| String testDisplayName = '$suiteName/$testName'; |
| - var htmlPath = _createUrlPathFromFile(new Path(htmlFile)); |
| + var htmlPath = _createUrlPathFromFile(new Path(htmlFile.toFilePath())); |
| var fullHtmlPath = _getUriForBrowserTest(info, htmlPath, |
| null, null); |
| var commands = [CommandBuilder.instance.getBrowserHtmlTestCommand( |