 Chromium Code Reviews
 Chromium Code Reviews Issue 9233015:
  Make test.dart run web tests on Windows.  (Closed) 
  Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
    
  
    Issue 9233015:
  Make test.dart run web tests on Windows.  (Closed) 
  Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/| Index: tools/testing/dart/test_suite.dart | 
| =================================================================== | 
| --- tools/testing/dart/test_suite.dart (revision 3505) | 
| +++ tools/testing/dart/test_suite.dart (working copy) | 
| @@ -409,7 +409,15 @@ | 
| // the client/samples/dartcombat test to its css file, remove the | 
| // "../../" from this path, and move this out of the isWebTest guard. | 
| // Also remove getHtmlName, and just use test.html. | 
| - htmlPath = '${tempDir.path}/../../${getHtmlName(filename)}'; | 
| + // TODO(efortuna): this shortening of htmlFilename is a band-aid until | 
| + // the above gets fixed. Windows cannot have paths that are longer than | 
| + // 260 characters, and without this hack, we were running past the | 
| + // limit. | 
| + String htmlFilename = getHtmlName(filename); | 
| + while ('${tempDir.path}/../../$htmlFilename'.length >= 260) { | 
| + htmlFilename = htmlFilename.substring(htmlFilename.length~/2); | 
| + } | 
| + htmlPath = '${tempDir.path}/../../$htmlFilename'; | 
| } | 
| final String scriptPath = (component == 'dartium') ? | 
| dartWrapperFilename : compiledDartWrapperFilename; | 
| @@ -443,9 +451,9 @@ | 
| if (libdir == '') { | 
| libdir = '$dartDir/frog/lib'; | 
| } | 
| - compilerArgs.addAll(['--libdir=$libdir', | 
| - '--compile-only', | 
| - '--out=$compiledDartWrapperFilename']); | 
| + compilerArgs.addAll(['--compile-only', | 
| + '--out=$compiledDartWrapperFilename', | 
| + '--libdir=$libdir']); | 
| compilerArgs.addAll(vmOptions); | 
| compilerArgs.add(dartWrapperFilename); | 
| break; | 
| @@ -461,9 +469,14 @@ | 
| String executable = getFilename(dumpRenderTreeFilename); | 
| List<String> args; | 
| if (component == 'webdriver') { | 
| - // TODO(efortuna): These paths are not OS independent! | 
| executable = '$dartDir/tools/testing/run_selenium.py'; | 
| - args = ['--out', htmlPath, '--browser', configuration['browser']]; | 
| + if (new Platform().operatingSystem() == 'windows') { | 
| + // For Windows, the first command, must have the Windows | 
| + // slash direction. | 
| + // TODO(efortuna): Get rid of this hack when issue 1306 is fixed. | 
| + executable = executable.replaceAll('/', '\\'); | 
| + } | 
| + args = ['--out=$htmlPath', '--browser=${configuration["browser"]}']; | 
| } else { | 
| args = ['--no-timeout']; | 
| if (component == 'dartium') { | 
| @@ -907,14 +920,16 @@ | 
| static String compilerName(Map configuration) { | 
| String postfix = | 
| - (new Platform().operatingSystem() == 'windows') ? '.exe' : ''; | 
| + ((new Platform().operatingSystem() == 'windows') && | 
| + (configuration['component'] != 'frogium' && | 
| + configuration['component'] != 'webdriver')) ? '.exe' : ''; | 
| 
Bill Hesse
2012/01/24 09:29:22
I meant that 2/3 of the condition here can be elim
 
Emily Fortuna
2012/01/24 17:20:22
Right. I ended up fixing it in a new CL here (http
 | 
| switch (configuration['component']) { | 
| case 'chromium': | 
| case 'dartc': | 
| return 'compiler/bin/dartc$postfix'; | 
| case 'frogium': | 
| case 'webdriver': | 
| - return 'frog/bin/frogsh$postfix'; | 
| + return 'frog/bin/frogsh'; | 
| default: | 
| throw "Unknown compiler for: ${configuration['component']}"; | 
| } |