| 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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 dartWrapperFilename : compiledDartWrapperFilename; | 1019 dartWrapperFilename : compiledDartWrapperFilename; |
| 1020 scriptPath = _createUrlPathFromFile(new Path(scriptPath)); | 1020 scriptPath = _createUrlPathFromFile(new Path(scriptPath)); |
| 1021 | 1021 |
| 1022 if (new File(pngPath.toNativePath()).existsSync()) { | 1022 if (new File(pngPath.toNativePath()).existsSync()) { |
| 1023 expectedOutput = pngPath; | 1023 expectedOutput = pngPath; |
| 1024 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath")); | 1024 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath")); |
| 1025 } else if (new File(txtPath.toNativePath()).existsSync()) { | 1025 } else if (new File(txtPath.toNativePath()).existsSync()) { |
| 1026 expectedOutput = txtPath; | 1026 expectedOutput = txtPath; |
| 1027 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath")); | 1027 content = getHtmlLayoutContents(scriptType, new Path("$scriptPath")); |
| 1028 } else { | 1028 } else { |
| 1029 if (compiler == "dart2js" && configuration["csp"]) { |
| 1030 scriptPath = scriptPath.replaceFirst('/test.js', '/precompiled.js'); |
| 1031 } |
| 1032 |
| 1029 content = getHtmlContents(filename, scriptType, | 1033 content = getHtmlContents(filename, scriptType, |
| 1030 new Path("$scriptPath")); | 1034 new Path("$scriptPath")); |
| 1031 } | 1035 } |
| 1032 htmlTest.writeStringSync(content); | 1036 htmlTest.writeStringSync(content); |
| 1033 htmlTest.closeSync(); | 1037 htmlTest.closeSync(); |
| 1034 } | 1038 } |
| 1035 | 1039 |
| 1036 if (compiler != 'none') { | 1040 if (compiler != 'none') { |
| 1037 commands.add(_compileCommand( | 1041 commands.add(_compileCommand( |
| 1038 dartWrapperFilename, compiledDartWrapperFilename, | 1042 dartWrapperFilename, compiledDartWrapperFilename, |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1870 // args.add("--verbose"); | 1874 // args.add("--verbose"); |
| 1871 if (!isBrowserRuntime(configuration['runtime'])) { | 1875 if (!isBrowserRuntime(configuration['runtime'])) { |
| 1872 args.add("--allow-mock-compilation"); | 1876 args.add("--allow-mock-compilation"); |
| 1873 args.add("--categories=all"); | 1877 args.add("--categories=all"); |
| 1874 } | 1878 } |
| 1875 } | 1879 } |
| 1876 if ((compiler == "dart2js" || compiler == "dart2dart") && | 1880 if ((compiler == "dart2js" || compiler == "dart2dart") && |
| 1877 configuration["minified"]) { | 1881 configuration["minified"]) { |
| 1878 args.add("--minify"); | 1882 args.add("--minify"); |
| 1879 } | 1883 } |
| 1880 if (compiler == "dart2js" && configuration["csp"]) { | |
| 1881 args.add("--disallow-unsafe-eval"); | |
| 1882 } | |
| 1883 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { | 1884 if (compiler == "dartanalyzer" || compiler == "dart2analyzer") { |
| 1884 args.add("--show-package-warnings"); | 1885 args.add("--show-package-warnings"); |
| 1885 } | 1886 } |
| 1886 return args; | 1887 return args; |
| 1887 } | 1888 } |
| 1888 | 1889 |
| 1889 static bool usesWebDriver(String runtime) { | 1890 static bool usesWebDriver(String runtime) { |
| 1890 const BROWSERS = const [ | 1891 const BROWSERS = const [ |
| 1891 'dartium', | 1892 'dartium', |
| 1892 'ie9', | 1893 'ie9', |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2026 * $pass tests are expected to pass | 2027 * $pass tests are expected to pass |
| 2027 * $failOk tests are expected to fail that we won't fix | 2028 * $failOk tests are expected to fail that we won't fix |
| 2028 * $fail tests are expected to fail that we should fix | 2029 * $fail tests are expected to fail that we should fix |
| 2029 * $crash tests are expected to crash that we should fix | 2030 * $crash tests are expected to crash that we should fix |
| 2030 * $timeout tests are allowed to timeout | 2031 * $timeout tests are allowed to timeout |
| 2031 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2032 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 2032 """; | 2033 """; |
| 2033 print(report); | 2034 print(report); |
| 2034 } | 2035 } |
| 2035 } | 2036 } |
| OLD | NEW |