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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 } | 963 } |
964 | 964 |
965 List<String> args = <String>[]; | 965 List<String> args = <String>[]; |
966 var basePath = TestUtils.dartDir().toString(); | 966 var basePath = TestUtils.dartDir().toString(); |
967 if (!htmlPath.startsWith('/') && !htmlPath.startsWith('http')) { | 967 if (!htmlPath.startsWith('/') && !htmlPath.startsWith('http')) { |
968 htmlPath = '/$htmlPath'; | 968 htmlPath = '/$htmlPath'; |
969 } | 969 } |
970 htmlPath = htmlPath.startsWith(basePath) ? | 970 htmlPath = htmlPath.startsWith(basePath) ? |
971 htmlPath.substring(basePath.length) : htmlPath; | 971 htmlPath.substring(basePath.length) : htmlPath; |
972 String fullHtmlPath = htmlPath; | 972 String fullHtmlPath = htmlPath; |
| 973 var searchStr = '?'; |
973 if (!htmlPath.startsWith('http')) { | 974 if (!htmlPath.startsWith('http')) { |
974 // Note: If we run test.py with the "--list" option, no http servers | 975 // Note: If we run test.py with the "--list" option, no http servers |
975 // will be started. Therefore serverList is an empty list in this | 976 // will be started. Therefore serverList is an empty list in this |
976 // case. So we use PORT/CROSS_ORIGIN_PORT instead of real ports. | 977 // case. So we use PORT/CROSS_ORIGIN_PORT instead of real ports. |
977 var serverPort = "PORT"; | 978 var serverPort = "PORT"; |
978 var crossOriginPort = "CROSS_ORIGIN_PORT"; | 979 var crossOriginPort = "CROSS_ORIGIN_PORT"; |
979 if (!configuration['list']) { | 980 if (!configuration['list']) { |
980 serverPort = serverList[0].port.toString(); | 981 serverPort = serverList[0].port.toString(); |
981 crossOriginPort = serverList[1].port.toString(); | 982 crossOriginPort = serverList[1].port.toString(); |
982 } | 983 } |
983 fullHtmlPath = 'http://127.0.0.1:$serverPort$htmlPath?' | 984 fullHtmlPath = 'http://127.0.0.1:$serverPort$htmlPath${searchStr}' |
984 'crossOriginPort=$crossOriginPort'; | 985 'crossOriginPort=$crossOriginPort'; |
| 986 searchStr = '&'; |
985 } | 987 } |
986 if (info.optionsFromFile['isMultiHtmlTest'] | 988 if (info.optionsFromFile['isMultiHtmlTest'] |
987 && subtestNames.length > 0) { | 989 && subtestNames.length > 0) { |
988 fullHtmlPath = '${fullHtmlPath}#${subtestNames[subtestIndex]}'; | 990 fullHtmlPath = '${fullHtmlPath}${searchStr}group=' |
| 991 '${subtestNames[subtestIndex]}'; |
989 } | 992 } |
990 | 993 |
991 if (TestUtils.usesWebDriver(runtime)) { | 994 if (TestUtils.usesWebDriver(runtime)) { |
992 args = [ | 995 args = [ |
993 dartDir.append('tools/testing/run_selenium.py').toNativePath(), | 996 dartDir.append('tools/testing/run_selenium.py').toNativePath(), |
994 '--browser=$runtime', | 997 '--browser=$runtime', |
995 '--timeout=${configuration["timeout"] - 2}', | 998 '--timeout=${configuration["timeout"] - 2}', |
996 '--out="$fullHtmlPath"']; | 999 '--out="$fullHtmlPath"']; |
997 if (runtime == 'dartium') { | 1000 if (runtime == 'dartium') { |
998 args.add('--executable=$dartiumFilename'); | 1001 args.add('--executable=$dartiumFilename'); |
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 * $pass tests are expected to pass | 1910 * $pass tests are expected to pass |
1908 * $failOk tests are expected to fail that we won't fix | 1911 * $failOk tests are expected to fail that we won't fix |
1909 * $fail tests are expected to fail that we should fix | 1912 * $fail tests are expected to fail that we should fix |
1910 * $crash tests are expected to crash that we should fix | 1913 * $crash tests are expected to crash that we should fix |
1911 * $timeout tests are allowed to timeout | 1914 * $timeout tests are allowed to timeout |
1912 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1915 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
1913 """; | 1916 """; |
1914 print(report); | 1917 print(report); |
1915 } | 1918 } |
1916 } | 1919 } |
OLD | NEW |