Files
sdk/pkg/test_runner/bin/launch_browser.dart
T
Robert Nystrom c1b56a9ea0 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 <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2019-06-15 01:02:50 +00:00

42 lines
1.3 KiB
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/// Simple command line interface to launching browsers.
/// Uses the browser_controller framework.
/// The usage is:
/// DARTBIN launch_browser.dart BROWSER_NAME URL
/// DARTBIN should be the checked in stable binary.
import 'package:test_runner/src/browser_controller.dart';
import 'package:test_runner/src/configuration.dart';
void printHelp() {
print("Usage pattern:");
print("launch_browser.dart browser url");
print("Supported browsers: ${Browser.supportedBrowsers}");
}
void main(List<String> arguments) {
if (arguments.length != 2) {
print("Wrong number of arguments, please pass in exactly two arguments");
printHelp();
return;
}
var name = arguments[0];
if (!Browser.supportedBrowser(name)) {
print("Specified browser not supported");
printHelp();
return;
}
var runtime = Runtime.find(name);
var configuration = TestConfiguration(
configuration: Configuration(
"dummy configuration", null, null, null, runtime, null));
var executable = configuration.browserLocation;
var browser = Browser.byRuntime(runtime, executable);
browser.start(arguments[1]);
}