Commit 441a62a4 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Support an environment-specified VM service URL (#6497)

If a URL is not explicitly specified by the test author, check for an
environment-specified URL before falling back to the default value.
parent 5032019f
......@@ -73,9 +73,13 @@ class FlutterDriver {
///
/// Resumes the application if it is currently paused (e.g. at a breakpoint).
///
/// [dartVmServiceUrl] is the URL to Dart observatory (a.k.a. VM service). By
/// default it connects to `http://localhost:8183`.
static Future<FlutterDriver> connect({String dartVmServiceUrl: 'http://localhost:8183'}) async {
/// [dartVmServiceUrl] is the URL to Dart observatory (a.k.a. VM service). If
/// not specified, the URL specified by the `VM_SERVICE_URL` environment
/// variable is used, or 'http://localhost:8183'.
static Future<FlutterDriver> connect({String dartVmServiceUrl}) async {
dartVmServiceUrl ??= Platform.environment['VM_SERVICE_URL'];
dartVmServiceUrl ??= 'http://localhost:8183';
// Connect to Dart VM servcies
_log.info('Connecting to Flutter application at $dartVmServiceUrl');
VMServiceClientConnection connection = await vmServiceConnectFunction(dartVmServiceUrl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment