Skip to content

Commit c1b56a9

Browse files
munificentcommit-bot@chromium.org
authored andcommitted
Catch the test_runner codebase up to somewhat modern practices.
- Run dartfmt --fix. This converts JavaDoc comments to "///", removes "new" and extraneous "const", and a couple of other things. - Fix SCREAMING_CAPS constants to lowerCamelCase. - Use collection literals where possible. - Use UI-as-code in a couple of places where it seemed obvious. - Use "var" for more local variables. - Use "const" instead of "final" when possible. - Make members private when possible. Deleted a few that then became obviously unused. - ".length > 0" -> ".isNotEmpty". There are no meaningful changes. Change-Id: Ic6c5a74b2af9b3ebcbe881dbed69f65488bdef09 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105880 Commit-Queue: Bob Nystrom <[email protected]> Reviewed-by: William Hesse <[email protected]>
1 parent 99e8a9f commit c1b56a9

35 files changed

Lines changed: 2450 additions & 2643 deletions

pkg/test_runner/bin/http_server.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:test_runner/src/utils.dart';
88
import 'package:test_runner/src/vendored_pkg/args/args.dart';
99

1010
void main(List<String> arguments) {
11-
var parser = new ArgParser();
11+
var parser = ArgParser();
1212
parser.addOption('port',
1313
abbr: 'p',
1414
help: 'The main server port we wish to respond to requests.',
@@ -33,7 +33,7 @@ void main(List<String> arguments) {
3333
if (args['help'] as bool) {
3434
print(parser.getUsage());
3535
} else {
36-
var servers = new TestingServers(
36+
var servers = TestingServers(
3737
args['build-directory'] as String,
3838
args['csp'] as bool,
3939
Runtime.find(args['runtime'] as String),

pkg/test_runner/bin/launch_browser.dart

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
/**
6-
* Simple command line interface to launching browsers.
7-
* Uses the browser_controller framework.
8-
* The usage is:
9-
* DARTBIN launch_browser.dart BROWSER_NAME URL
10-
* DARTBIN should be the checked in stable binary.
11-
*/
5+
/// Simple command line interface to launching browsers.
6+
/// Uses the browser_controller framework.
7+
/// The usage is:
8+
/// DARTBIN launch_browser.dart BROWSER_NAME URL
9+
/// DARTBIN should be the checked in stable binary.
1210
1311
import 'package:test_runner/src/browser_controller.dart';
1412
import 'package:test_runner/src/configuration.dart';
1513

1614
void printHelp() {
1715
print("Usage pattern:");
1816
print("launch_browser.dart browser url");
19-
print("Supported browsers: ${Browser.SUPPORTED_BROWSERS}");
17+
print("Supported browsers: ${Browser.supportedBrowsers}");
2018
}
2119

2220
void main(List<String> arguments) {
@@ -34,10 +32,10 @@ void main(List<String> arguments) {
3432
}
3533

3634
var runtime = Runtime.find(name);
37-
var configuration = new TestConfiguration(
38-
configuration: new Configuration(
35+
var configuration = TestConfiguration(
36+
configuration: Configuration(
3937
"dummy configuration", null, null, null, runtime, null));
4038
var executable = configuration.browserLocation;
41-
var browser = new Browser.byRuntime(runtime, executable);
39+
var browser = Browser.byRuntime(runtime, executable);
4240
browser.start(arguments[1]);
4341
}

pkg/test_runner/bin/package_testing_support.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void main(List<String> arguments) {
1111
Repository.uri = Uri.base;
1212
var configurations = <TestConfiguration>[];
1313
for (var argument in arguments) {
14-
configurations.addAll(new OptionsParser().parse(argument.split(" ")));
14+
configurations.addAll(OptionsParser().parse(argument.split(" ")));
1515
}
1616
testConfigurations(configurations);
1717
}

pkg/test_runner/bin/test_runner.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import "package:test_runner/src/test_configurations.dart";
2727
/// Runs all of the tests specified by the given command line [arguments].
2828
void main(List<String> arguments) {
2929
// Parse the command line arguments to a configuration.
30-
var parser = new OptionsParser();
30+
var parser = OptionsParser();
3131
var configurations = parser.parse(arguments);
3232
if (configurations == null || configurations.isEmpty) return;
3333

0 commit comments

Comments
 (0)