| 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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 if (compiler != 'none' && | 993 if (compiler != 'none' && |
| 994 customHtml.readAsStringSync().contains('polymer/boot.js')) { | 994 customHtml.readAsStringSync().contains('polymer/boot.js')) { |
| 995 | 995 |
| 996 commands.add(_polymerDeployCommand( | 996 commands.add(_polymerDeployCommand( |
| 997 customHtmlPath, tempDir, optionsFromFile)); | 997 customHtmlPath, tempDir, optionsFromFile)); |
| 998 | 998 |
| 999 htmlPath = '$tempDir/test/$nameNoExt.html'; | 999 htmlPath = '$tempDir/test/$nameNoExt.html'; |
| 1000 dartWrapperFilename = '${htmlPath}_bootstrap.dart'; | 1000 dartWrapperFilename = '${htmlPath}_bootstrap.dart'; |
| 1001 compiledDartWrapperFilename = '$dartWrapperFilename.js'; | 1001 compiledDartWrapperFilename = '$dartWrapperFilename.js'; |
| 1002 } else { | 1002 } else { |
| 1003 htmlPath = '$tempDir/test.html'; | 1003 htmlPath = customHtmlPath; |
| 1004 dartWrapperFilename = filePath.toNativePath(); | |
| 1005 | |
| 1006 var htmlContents = customHtml.readAsStringSync(); | |
| 1007 if (compiler == 'none') { | |
| 1008 htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%', | |
| 1009 '<script type="application/dart" ' | |
| 1010 'src="${_createUrlPathFromFile(filePath)}"></script>\n' | |
| 1011 '<script type="text/javascript" ' | |
| 1012 'src="/packages/browser/dart.js"></script>'); | |
| 1013 } else { | |
| 1014 htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%', | |
| 1015 '<script src="$nameNoExt.js"></script>'); | |
| 1016 compiledDartWrapperFilename = '$tempDir/$nameNoExt.js'; | |
| 1017 } | |
| 1018 new File(htmlPath).writeAsStringSync(htmlContents); | |
| 1019 } | 1004 } |
| 1020 } else { | 1005 } else { |
| 1021 htmlPath = '$tempDir/test.html'; | 1006 htmlPath = '$tempDir/test.html'; |
| 1022 if (isWrappingRequired && !isWebTest) { | 1007 if (isWrappingRequired && !isWebTest) { |
| 1023 // test.dart will import the dart test. | 1008 // test.dart will import the dart test. |
| 1024 _createWrapperFile(dartWrapperFilename, filePath); | 1009 _createWrapperFile(dartWrapperFilename, filePath); |
| 1025 } else { | 1010 } else { |
| 1026 dartWrapperFilename = filename; | 1011 dartWrapperFilename = filename; |
| 1027 } | 1012 } |
| 1028 | 1013 |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 * $pass tests are expected to pass | 2026 * $pass tests are expected to pass |
| 2042 * $failOk tests are expected to fail that we won't fix | 2027 * $failOk tests are expected to fail that we won't fix |
| 2043 * $fail tests are expected to fail that we should fix | 2028 * $fail tests are expected to fail that we should fix |
| 2044 * $crash tests are expected to crash that we should fix | 2029 * $crash tests are expected to crash that we should fix |
| 2045 * $timeout tests are allowed to timeout | 2030 * $timeout tests are allowed to timeout |
| 2046 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2031 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 2047 """; | 2032 """; |
| 2048 print(report); | 2033 print(report); |
| 2049 } | 2034 } |
| 2050 } | 2035 } |
| OLD | NEW |