| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 if (uri.pathSegments.length > 1) { | 1409 if (uri.pathSegments.length > 1) { |
| 1410 Fail('HTML test scripts must be in test directory: $scriptPath'); | 1410 Fail('HTML test scripts must be in test directory: $scriptPath'); |
| 1411 break; | 1411 break; |
| 1412 } | 1412 } |
| 1413 Uri script = testUri.resolveUri(uri); | 1413 Uri script = testUri.resolveUri(uri); |
| 1414 Uri copiedScript = tempUri.resolveUri(uri); | 1414 Uri copiedScript = tempUri.resolveUri(uri); |
| 1415 if (compiler == 'none' || scriptPath.endsWith('.js')) { | 1415 if (compiler == 'none' || scriptPath.endsWith('.js')) { |
| 1416 new File.fromUri(copiedScript).writeAsStringSync( | 1416 new File.fromUri(copiedScript).writeAsStringSync( |
| 1417 new File.fromUri(script).readAsStringSync()); | 1417 new File.fromUri(script).readAsStringSync()); |
| 1418 } else { | 1418 } else { |
| 1419 var destination = copiedScript.toFilePath(); |
| 1420 if (compileToJS) { |
| 1421 destination = destination.replaceFirst(dartExtension, '.js'); |
| 1422 } |
| 1419 commands.add(_compileCommand( | 1423 commands.add(_compileCommand( |
| 1420 script.toFilePath(), | 1424 script.toFilePath(), |
| 1421 copiedScript.toFilePath().replaceFirst(dartExtension, '.js'), | 1425 destination, |
| 1422 compiler, | 1426 compiler, |
| 1423 tempDir, | 1427 tempDir, |
| 1424 info.optionsFromFile)); | 1428 info.optionsFromFile)); |
| 1425 } | 1429 } |
| 1426 } | 1430 } |
| 1427 } | 1431 } |
| 1428 final Uri htmlFile = tempUri.resolve(filePath.filename); | 1432 final Uri htmlFile = tempUri.resolve(filePath.filename); |
| 1429 new File.fromUri(htmlFile).writeAsStringSync(contents); | 1433 new File.fromUri(htmlFile).writeAsStringSync(contents); |
| 1430 | 1434 |
| 1431 var htmlPath = _createUrlPathFromFile(new Path(htmlFile.toFilePath())); | 1435 var htmlPath = _createUrlPathFromFile(new Path(htmlFile.toFilePath())); |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2389 for (var key in PATH_REPLACEMENTS.keys) { | 2393 for (var key in PATH_REPLACEMENTS.keys) { |
| 2390 if (path.startsWith(key)) { | 2394 if (path.startsWith(key)) { |
| 2391 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2395 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
| 2392 break; | 2396 break; |
| 2393 } | 2397 } |
| 2394 } | 2398 } |
| 2395 } | 2399 } |
| 2396 return path; | 2400 return path; |
| 2397 } | 2401 } |
| 2398 } | 2402 } |
| OLD | NEW |