| 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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 dartWrapperFilename = filePath.toNativePath(); | 1007 dartWrapperFilename = filePath.toNativePath(); |
| 1008 | 1008 |
| 1009 var htmlContents = customHtml.readAsStringSync(); | 1009 var htmlContents = customHtml.readAsStringSync(); |
| 1010 if (compiler == 'none') { | 1010 if (compiler == 'none') { |
| 1011 htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%', | 1011 htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%', |
| 1012 '<script type="application/dart" ' | 1012 '<script type="application/dart" ' |
| 1013 'src="${_createUrlPathFromFile(filePath)}"></script>\n' | 1013 'src="${_createUrlPathFromFile(filePath)}"></script>\n' |
| 1014 '<script type="text/javascript" ' | 1014 '<script type="text/javascript" ' |
| 1015 'src="/packages/browser/dart.js"></script>'); | 1015 'src="/packages/browser/dart.js"></script>'); |
| 1016 } else { | 1016 } else { |
| 1017 compiledDartWrapperFilename = '$tempDir/$nameNoExt.js'; |
| 1018 var jsFile = '$nameNoExt.js'; |
| 1019 if (configuration['csp']) { |
| 1020 jsFile = '$nameNoExt.precompiled.js'; |
| 1021 } |
| 1017 htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%', | 1022 htmlContents = htmlContents.replaceAll('%TEST_SCRIPTS%', |
| 1018 '<script src="$nameNoExt.js"></script>'); | 1023 '<script src="$jsFile"></script>'); |
| 1019 compiledDartWrapperFilename = '$tempDir/$nameNoExt.js'; | |
| 1020 } | 1024 } |
| 1021 new File(htmlPath).writeAsStringSync(htmlContents); | 1025 new File(htmlPath).writeAsStringSync(htmlContents); |
| 1022 } | 1026 } |
| 1023 } else { | 1027 } else { |
| 1024 htmlPath = '$tempDir/test.html'; | 1028 htmlPath = '$tempDir/test.html'; |
| 1025 if (isWrappingRequired && !isWebTest) { | 1029 if (isWrappingRequired && !isWebTest) { |
| 1026 // test.dart will import the dart test. | 1030 // test.dart will import the dart test. |
| 1027 _createWrapperFile(dartWrapperFilename, filePath); | 1031 _createWrapperFile(dartWrapperFilename, filePath); |
| 1028 } else { | 1032 } else { |
| 1029 dartWrapperFilename = filename; | 1033 dartWrapperFilename = filename; |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2048 * $pass tests are expected to pass | 2052 * $pass tests are expected to pass |
| 2049 * $failOk tests are expected to fail that we won't fix | 2053 * $failOk tests are expected to fail that we won't fix |
| 2050 * $fail tests are expected to fail that we should fix | 2054 * $fail tests are expected to fail that we should fix |
| 2051 * $crash tests are expected to crash that we should fix | 2055 * $crash tests are expected to crash that we should fix |
| 2052 * $timeout tests are allowed to timeout | 2056 * $timeout tests are allowed to timeout |
| 2053 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2057 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 2054 """; | 2058 """; |
| 2055 print(report); | 2059 print(report); |
| 2056 } | 2060 } |
| 2057 } | 2061 } |
| OLD | NEW |