From 484f6e754af3872ff0c40a0157b6a44423d21264 Mon Sep 17 00:00:00 2001 From: Ben Konyi Date: Fri, 19 Apr 2019 13:55:34 -0700 Subject: [PATCH] Fixed flutter_attach_test not respecting authentication codes (#31321) --- dev/devicelab/bin/tasks/flutter_attach_test.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/devicelab/bin/tasks/flutter_attach_test.dart b/dev/devicelab/bin/tasks/flutter_attach_test.dart index ef4a9a8b52..3cf04035a3 100644 --- a/dev/devicelab/bin/tasks/flutter_attach_test.dart +++ b/dev/devicelab/bin/tasks/flutter_attach_test.dart @@ -128,13 +128,14 @@ void main() { // If the next line fails, your device may not support regexp search. final String observatoryLine = await device.adb(['logcat', '-e', 'Observatory listening on http:', '-m', '1', '-T', currentTime]); print('Found observatory line: $observatoryLine'); - final String observatoryPort = RegExp(r'Observatory listening on http://.*:([0-9]+)').firstMatch(observatoryLine)[1]; - print('Extracted observatory port: $observatoryPort'); + final String observatoryUri = RegExp('Observatory listening on ((http|\/\/)[a-zA-Z0-9:/=_\\-\.\\[\\]]+)').firstMatch(observatoryLine)[1]; + print('Extracted observatory port: $observatoryUri'); section('Launching attach with given port'); attachProcess = await startProcess( path.join(flutterDirectory.path, 'bin', 'flutter'), - ['--suppress-analytics', 'attach', '--debug-port', observatoryPort, '-d', device.deviceId], + ['--suppress-analytics', 'attach', '--debug-uri', + observatoryUri, '-d', device.deviceId], isBot: false, // we just want to test the output, not have any debugging info ); await testReload(attachProcess);