Chromium Code Reviews| Index: tools/testing/dart/test_suite.dart |
| diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
| index ce30a7362eeb69ef33907a72bead29eae239b263..c73dc7c28841b77b49774be1b91550146699059b 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -2394,6 +2394,8 @@ class TestUtils { |
| static List<String> getExtraVmOptions(Map configuration) => |
| getExtraOptions(configuration, 'vm_options'); |
| + static int shortNameCounter = 0; // Make unique short file names on Windows. |
| + |
| static String getShortName(String path) { |
| final PATH_REPLACEMENTS = const { |
| "pkg_polymer_e2e_test_bad_import_test": "polymer_bi", |
| @@ -2457,6 +2459,7 @@ class TestUtils { |
| } |
| path = path.replaceAll('/', '_'); |
| final int WINDOWS_SHORTEN_PATH_LIMIT = 58; |
| + final int WINDOWS_PATH_END_LENGTH = 30; |
| if (Platform.operatingSystem == 'windows' && |
| path.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
| for (var key in PATH_REPLACEMENTS.keys) { |
| @@ -2465,6 +2468,11 @@ class TestUtils { |
| break; |
| } |
| } |
| + if (path.length > WINDOWS_SHORTEN_PATH_LIMIT) { |
| + ++shortNameCounter; |
| + var pathEnd = path.substring(path.length - WINDOWS_PATH_END_LENGTH); |
| + path = "short${shortNameCounter}_$pathEnd"; |
|
Søren Gjesse
2016/06/29 15:35:56
Maybe add __ in front as well to lower the probabi
|
| + } |
| } |
| return path; |
| } |