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 397db586465241978ba2d2d1089fb35ef55bf55e..6508ca8b0ef461c7424a0a5d049fc457e7ce1ba0 100644 |
| --- a/tools/testing/dart/test_suite.dart |
| +++ b/tools/testing/dart/test_suite.dart |
| @@ -421,12 +421,13 @@ abstract class TestSuite { |
| */ |
| Future<List> listDir(Path path, Function isValid) { |
| var dir = new Directory(path.toNativePath()); |
| - return dir.exists().then((var exist) { |
| - if (!exist) return []; |
| + return dir.exists().then((exists) { |
| + if (!exists) return []; |
| return dir |
| .list(recursive: false) |
| .where((fse) => fse is Directory) |
| - .map((Directory directory) { |
| + .map((FileSystemEntity entity) { |
| + var directory = entity as Directory; |
|
Bill Hesse
2017/05/04 15:49:38
I'm pretty annoyed that this is needed. Oh well.
Bob Nystrom
2017/07/18 18:06:16
Yes. The long term fix is to add a method to Itera
|
| var fullPath = directory.absolute.path; |
| var packageName = new Path(fullPath).filename; |
| if (isValid(packageName)) { |
| @@ -471,8 +472,8 @@ class CCTestSuite extends TestSuite { |
| CCTestSuite(Map configuration, String suiteName, String runnerName, |
| this.statusFilePaths, |
| {this.testPrefix: ''}) |
| - : super(configuration, suiteName), |
| - dartDir = TestUtils.dartDir.toNativePath() { |
| + : dartDir = TestUtils.dartDir.toNativePath(), |
| + super(configuration, suiteName) { |
| // For running the tests we use the given '$runnerName' binary |
| targetRunnerPath = '$buildDir/$runnerName'; |
| @@ -581,11 +582,11 @@ class StandardTestSuite extends TestSuite { |
| StandardTestSuite(Map configuration, String suiteName, Path suiteDirectory, |
| this.statusFilePaths, |
| {this.isTestFilePredicate, bool recursive: false}) |
| - : super(configuration, suiteName), |
| - dartDir = TestUtils.dartDir, |
| + : dartDir = TestUtils.dartDir, |
| listRecursively = recursive, |
| suiteDir = TestUtils.dartDir.join(suiteDirectory), |
| - extraVmOptions = TestUtils.getExtraVmOptions(configuration) { |
| + extraVmOptions = TestUtils.getExtraVmOptions(configuration), |
| + super(configuration, suiteName) { |
| if (!useSdk) { |
| _dart2JsBootstrapDependencies = []; |
| } else { |
| @@ -727,8 +728,8 @@ class StandardTestSuite extends TestSuite { |
| var lister = dir |
| .list(recursive: listRecursively) |
| .where((fse) => fse is File) |
| - .forEach((File f) { |
| - enqueueFile(f.path, group); |
| + .forEach((FileSystemEntity entity) { |
| + enqueueFile((entity as File).path, group); |
| }); |
| group.add(lister); |
| } |
| @@ -858,7 +859,7 @@ class StandardTestSuite extends TestSuite { |
| allVmOptions = new List.from(vmOptions)..addAll(extraVmOptions); |
| } |
| - var commands = []..addAll(baseCommands); |
| + var commands = baseCommands.toList(); |
| commands.addAll( |
| makeCommands(info, vmOptionsVarient, allVmOptions, commonArguments)); |
| enqueueNewTestCase(new TestCase( |
| @@ -1007,7 +1008,7 @@ class StandardTestSuite extends TestSuite { |
| assert(configuration.containsKey('_servers_')); |
| int serverPort = configuration['_servers_'].port; |
| int crossOriginPort = configuration['_servers_'].crossOriginPort; |
| - Map parameters = {'crossOriginPort': crossOriginPort.toString()}; |
| + var parameters = {'crossOriginPort': crossOriginPort.toString()}; |
| if (subtestName != null) { |
| parameters['group'] = subtestName; |
| } |
| @@ -1197,11 +1198,8 @@ class StandardTestSuite extends TestSuite { |
| _getUriForBrowserTest(htmlPath_subtest, subtestName).toString(); |
| if (runtime == "drt") { |
| - var dartFlags = []; |
| - var contentShellOptions = []; |
| - |
| - contentShellOptions.add('--no-timeout'); |
| - contentShellOptions.add('--run-layout-test'); |
| + var dartFlags = <String>[]; |
| + var contentShellOptions = ['--no-timeout', '--run-layout-test']; |
| // Disable the GPU under Linux and Dartium. If the GPU is enabled, |
| // Chrome may send a termination signal to a test. The test will be |
| @@ -1395,7 +1393,7 @@ class StandardTestSuite extends TestSuite { |
| } |
| List<String> commonArgumentsFromFile(Path filePath, Map optionsFromFile) { |
| - List args = TestUtils.standardOptions(configuration); |
| + var args = TestUtils.standardOptions(configuration); |
| String packages = packagesArgument( |
| optionsFromFile['packageRoot'], optionsFromFile['packages']); |
| @@ -2012,7 +2010,7 @@ class TestUtils { |
| } |
| static List<String> standardOptions(Map configuration) { |
| - List args = ["--ignore-unrecognized-flags"]; |
| + var args = ["--ignore-unrecognized-flags"]; |
| String compiler = configuration["compiler"]; |
| if (compiler == "dart2js") { |
| args = ['--generate-code-with-compile-time-errors', '--test-mode']; |