diff --git a/.github/ISSUE_TEMPLATE/5_performance_speed.md b/.github/ISSUE_TEMPLATE/5_performance_speed.md index ba7f3178adf14..889da8a45d1f6 100644 --- a/.github/ISSUE_TEMPLATE/5_performance_speed.md +++ b/.github/ISSUE_TEMPLATE/5_performance_speed.md @@ -41,7 +41,7 @@ assignees: '' can have an intuitive understanding of what happened. Don’t use "adb screenrecord", as that affects the performance of the profile run. -5. Open Flutter DevTools and save a timeline trace of the performance issue +5. Open Observatory and save a timeline trace of the performance issue so we know which functions might be causing it. See "How to Collect and Read Timeline Traces" on this blog post: https://medium.com/flutter/profiling-flutter-applications-using-the-timeline-a1a434964af3#a499 diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart index c6f5c0806c761..3a76a7328560a 100644 --- a/dev/devicelab/lib/framework/runner.dart +++ b/dev/devicelab/lib/framework/runner.dart @@ -202,7 +202,7 @@ Future runTask( .transform(const LineSplitter()) .listen((String line) { if (!uri.isCompleted) { - final Uri? serviceUri = parseServiceUri(line, prefix: RegExp('The Dart VM service is listening on ')); + final Uri? serviceUri = parseServiceUri(line, prefix: RegExp('(Observatory|The Dart VM service is) listening on ')); if (serviceUri != null) { uri.complete(serviceUri); } diff --git a/dev/devicelab/lib/framework/utils.dart b/dev/devicelab/lib/framework/utils.dart index ea45d1930f6eb..e30a685bd8914 100644 --- a/dev/devicelab/lib/framework/utils.dart +++ b/dev/devicelab/lib/framework/utils.dart @@ -664,14 +664,14 @@ Future runAndCaptureAsyncStacks(Future Function() callback) { bool canRun(String path) => _processManager.canRun(path); final RegExp _obsRegExp = - RegExp('A Dart VM Service .* is available at: '); + RegExp('An Observatory debugger .* is available at: '); final RegExp _obsPortRegExp = RegExp(r'(\S+:(\d+)/\S*)$'); final RegExp _obsUriRegExp = RegExp(r'((http|//)[a-zA-Z0-9:/=_\-\.\[\]]+)'); /// Tries to extract a port from the string. /// /// The `prefix`, if specified, is a regular expression pattern and must not contain groups. -/// `prefix` defaults to the RegExp: `A Dart VM Service .* is available at: `. +/// `prefix` defaults to the RegExp: `An Observatory debugger .* is available at: `. int? parseServicePort(String line, { Pattern? prefix, }) { @@ -689,7 +689,7 @@ int? parseServicePort(String line, { /// Tries to extract a URL from the string. /// /// The `prefix`, if specified, is a regular expression pattern and must not contain groups. -/// `prefix` defaults to the RegExp: `A Dart VM Service .* is available at: `. +/// `prefix` defaults to the RegExp: `An Observatory debugger .* is available at: `. Uri? parseServiceUri(String line, { Pattern? prefix, }) { diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart index b67538752831f..6cc1d0d9ed7b1 100644 --- a/dev/devicelab/lib/tasks/perf_tests.dart +++ b/dev/devicelab/lib/tasks/perf_tests.dart @@ -1184,11 +1184,11 @@ class PerfTestWithSkSL extends PerfTest { await _generateSkSL(); // Build the app with SkSL artifacts and run that app - final String vmServiceUri = await _runApp(skslPath: _skslJsonFileName); + final String observatoryUri = await _runApp(skslPath: _skslJsonFileName); // Attach to the running app and run the final driver test to get metrics. final TaskResult result = await internalRun( - existingApp: vmServiceUri, + existingApp: observatoryUri, ); _runProcess.kill(); @@ -1207,8 +1207,8 @@ class PerfTestWithSkSL extends PerfTest { // `--write-sksl-on-exit` option doesn't seem to be compatible with // `flutter drive --existing-app` as it will complain web socket connection // issues. - final String vmServiceUri = await _runApp(cacheSkSL: true); - await super.internalRun(cacheSkSL: true, existingApp: vmServiceUri); + final String observatoryUri = await _runApp(cacheSkSL: true); + await super.internalRun(cacheSkSL: true, existingApp: observatoryUri); _runProcess.kill(); await _runProcess.exitCode; diff --git a/dev/devicelab/test/utils_test.dart b/dev/devicelab/test/utils_test.dart index c51ac5afa99dc..ca3e12b3b2dc1 100644 --- a/dev/devicelab/test/utils_test.dart +++ b/dev/devicelab/test/utils_test.dart @@ -19,7 +19,7 @@ void main() { group('parse service', () { const String badOutput = 'No uri here'; - const String sampleOutput = 'A Dart VM Service on ' + const String sampleOutput = 'An Observatory debugger and profiler on ' 'Pixel 3 XL is available at: http://127.0.0.1:9090/LpjUpsdEjqI=/'; test('uri', () { diff --git a/packages/flutter/lib/src/foundation/binding.dart b/packages/flutter/lib/src/foundation/binding.dart index ad63760c45bef..c7fce102a7903 100644 --- a/packages/flutter/lib/src/foundation/binding.dart +++ b/packages/flutter/lib/src/foundation/binding.dart @@ -138,7 +138,7 @@ abstract class BindingBase { /// First calls [initInstances] to have bindings initialize their /// instance pointers and other state, then calls /// [initServiceExtensions] to have bindings initialize their - /// VM service extensions, if any. + /// observatory service extensions, if any. BindingBase() { developer.Timeline.startSync('Framework initialization'); assert(() { diff --git a/packages/flutter/lib/src/painting/shader_warm_up.dart b/packages/flutter/lib/src/painting/shader_warm_up.dart index 29bc0ecbc1cc9..6a28c258be8ca 100644 --- a/packages/flutter/lib/src/painting/shader_warm_up.dart +++ b/packages/flutter/lib/src/painting/shader_warm_up.dart @@ -69,10 +69,10 @@ abstract class ShaderWarmUp { /// /// To decide which draw operations to be added to your custom warm up /// process, consider capturing an skp using `flutter screenshot - /// --vm-service-uri= --type=skia` and analyzing it with + /// --observatory-uri= --type=skia` and analyzing it with /// . Alternatively, one may run the app with /// `flutter run --trace-skia` and then examine the raster thread in the - /// Flutter DevTools timeline to see which Skia draw operations are commonly used, + /// observatory timeline to see which Skia draw operations are commonly used, /// and which shader compilations are causing jank. @protected Future warmUpOnCanvas(ui.Canvas canvas); diff --git a/packages/flutter/lib/src/widgets/app.dart b/packages/flutter/lib/src/widgets/app.dart index 4c7380ca5eb85..6c344b322be61 100644 --- a/packages/flutter/lib/src/widgets/app.dart +++ b/packages/flutter/lib/src/widgets/app.dart @@ -1174,7 +1174,7 @@ class WidgetsApp extends StatefulWidget { /// If true, forces the performance overlay to be visible in all instances. /// - /// Used by the `showPerformanceOverlay` VM service extension. + /// Used by the `showPerformanceOverlay` observatory extension. static bool showPerformanceOverlayOverride = false; /// If true, forces the widget inspector to be visible. @@ -1184,12 +1184,12 @@ class WidgetsApp extends StatefulWidget { /// The inspector allows you to select a location on your device or emulator /// and view what widgets and render objects associated with it. An outline of /// the selected widget and some summary information is shown on device and - /// more detailed information is shown in the IDE or DevTools. + /// more detailed information is shown in the IDE or Observatory. static bool debugShowWidgetInspectorOverride = false; /// If false, prevents the debug banner from being visible. /// - /// Used by the `debugAllowBanner` VM service extension. + /// Used by the `debugAllowBanner` observatory extension. /// /// This is how `flutter run` turns off the banner when you take a screen shot /// with "s". diff --git a/packages/flutter/lib/src/widgets/debug.dart b/packages/flutter/lib/src/widgets/debug.dart index b6245a475ae34..3e8c84dc1b962 100644 --- a/packages/flutter/lib/src/widgets/debug.dart +++ b/packages/flutter/lib/src/widgets/debug.dart @@ -33,8 +33,8 @@ import 'table.dart'; /// Combined with [debugPrintScheduleBuildForStacks], this lets you watch a /// widget's dirty/clean lifecycle. /// -/// To get similar information but showing it on the timeline available from -/// Flutter DevTools rather than getting it in the console (where it can be +/// To get similar information but showing it on the timeline available from the +/// Observatory rather than getting it in the console (where it can be /// overwhelming), consider [debugProfileBuildsEnabled]. /// /// See also: diff --git a/packages/flutter/lib/src/widgets/widget_inspector.dart b/packages/flutter/lib/src/widgets/widget_inspector.dart index 83a28d97264d0..1ee8953bd1674 100644 --- a/packages/flutter/lib/src/widgets/widget_inspector.dart +++ b/packages/flutter/lib/src/widgets/widget_inspector.dart @@ -703,7 +703,7 @@ class _WidgetInspectorService = Object with WidgetInspectorService; /// operation making it easier to avoid memory leaks. /// /// All methods in this class are appropriate to invoke from debugging tools -/// using the VM service protocol to evaluate Dart expressions of the +/// using the Observatory service protocol to evaluate Dart expressions of the /// form `WidgetInspectorService.instance.methodName(arg1, arg2, ...)`. If you /// make changes to any instance method of this class you need to verify that /// the [Flutter IntelliJ Plugin](https://github.com/flutter/flutter-intellij/blob/master/README.md) @@ -712,7 +712,7 @@ class _WidgetInspectorService = Object with WidgetInspectorService; /// All methods returning String values return JSON. mixin WidgetInspectorService { /// Ring of cached JSON values to prevent JSON from being garbage - /// collected before it can be requested over the VM service protocol. + /// collected before it can be requested over the Observatory protocol. final List _serializeRing = List.filled(20, null); int _serializeRingIndex = 0; @@ -739,7 +739,7 @@ mixin WidgetInspectorService { /// when the inspection target changes on device. InspectorSelectionChangedCallback? selectionChangedCallback; - /// The VM service protocol does not keep alive object references so this + /// The Observatory protocol does not keep alive object references so this /// class needs to manually manage groups of objects that should be kept /// alive. final Map> _groups = >{}; @@ -1690,7 +1690,7 @@ mixin WidgetInspectorService { /// Wrapper around `json.encode` that uses a ring of cached values to prevent /// the Dart garbage collector from collecting objects between when - /// the value is returned over the VM service protocol and when the + /// the value is returned over the Observatory protocol and when the /// separate observatory protocol command has to be used to retrieve its full /// contents. // diff --git a/packages/flutter_tools/bin/fuchsia_tester.dart b/packages/flutter_tools/bin/fuchsia_tester.dart index b18a4191b11e4..d4ca21491174d 100644 --- a/packages/flutter_tools/bin/fuchsia_tester.dart +++ b/packages/flutter_tools/bin/fuchsia_tester.dart @@ -148,7 +148,7 @@ Future run(List args) async { ), ), watcher: collector, - enableVmService: collector != null, + enableObservatory: collector != null, precompiledDillFiles: tests, concurrency: math.max(1, globals.platform.numberOfProcessors - 2), icudtlPath: globals.fs.path.absolute(argResults[_kOptionIcudtl] as String), diff --git a/packages/flutter_tools/bin/xcode_backend.dart b/packages/flutter_tools/bin/xcode_backend.dart index 8eeab92b62147..ec85e9cba4b5d 100644 --- a/packages/flutter_tools/bin/xcode_backend.dart +++ b/packages/flutter_tools/bin/xcode_backend.dart @@ -60,9 +60,9 @@ class Context { // Thinning is handled during the bundle asset assemble build target, so just embed. embedFlutterFrameworks(); break; - case 'test_vm_service_bonjour_service': + case 'test_observatory_bonjour_service': // Exposed for integration testing only. - addVmServiceBonjourService(); + addObservatoryBonjourService(); } } @@ -220,11 +220,11 @@ class Context { ], ); - addVmServiceBonjourService(); + addObservatoryBonjourService(); } - // Add the vmService publisher Bonjour service to the produced app bundle Info.plist. - void addVmServiceBonjourService() { + // Add the observatory publisher Bonjour service to the produced app bundle Info.plist. + void addObservatoryBonjourService() { final String buildMode = parseFlutterBuildMode(); // Debug and profile only. @@ -239,13 +239,13 @@ class Context { // The file will be present on re-run. echo( '${environment['INFOPLIST_PATH'] ?? ''} does not exist. Skipping ' - '_dartVmService._tcp NSBonjourServices insertion. Try re-building to ' + '_dartobservatory._tcp NSBonjourServices insertion. Try re-building to ' 'enable "flutter attach".'); return; } // If there are already NSBonjourServices specified by the app (uncommon), - // insert the vmService service name to the existing list. + // insert the observatory service name to the existing list. ProcessResult result = runSync( 'plutil', [ @@ -265,19 +265,19 @@ class Context { '-insert', 'NSBonjourServices.0', '-string', - '_dartVmService._tcp', + '_dartobservatory._tcp', builtProductsPlist, ], ); } else { - // Otherwise, add the NSBonjourServices key and vmService service name. + // Otherwise, add the NSBonjourServices key and observatory service name. runSync( 'plutil', [ '-insert', 'NSBonjourServices', '-json', - '["_dartVmService._tcp"]', + '["_dartobservatory._tcp"]', builtProductsPlist, ], ); diff --git a/packages/flutter_tools/doc/attach.md b/packages/flutter_tools/doc/attach.md index 565115ded3f56..303cb8019070a 100644 --- a/packages/flutter_tools/doc/attach.md +++ b/packages/flutter_tools/doc/attach.md @@ -17,7 +17,7 @@ immediately discover the port will search for an already running Flutter app or module if available. Otherwise, the tool will wait for the next Flutter app or module to launch before attaching. -1. If the app or module is already running and the specific VM Service port is +1. If the app or module is already running and the specific observatory port is known, it can be explicitly provided to attach via the command-line, e.g. `$ flutter attach --debug-port 12345` diff --git a/packages/flutter_tools/doc/daemon.md b/packages/flutter_tools/doc/daemon.md index 775082911b3ee..15d144cf938ee 100644 --- a/packages/flutter_tools/doc/daemon.md +++ b/packages/flutter_tools/doc/daemon.md @@ -140,7 +140,7 @@ This is sent when an app is starting. The `params` field will be a map with the #### app.debugPort -This is sent when a VM service port is available for a started app. The `params` field will be a map with the fields `appId`, `port`, and `wsUri`. Clients should prefer using the `wsUri` field in preference to synthesizing a URI using the `port` field. An optional field, `baseUri`, is populated if a path prefix is required for setting breakpoints on the target device. +This is sent when an observatory port is available for a started app. The `params` field will be a map with the fields `appId`, `port`, and `wsUri`. Clients should prefer using the `wsUri` field in preference to synthesizing a URI using the `port` field. An optional field, `baseUri`, is populated if a path prefix is required for setting breakpoints on the target device. #### app.started diff --git a/packages/flutter_tools/lib/src/android/android_device.dart b/packages/flutter_tools/lib/src/android/android_device.dart index eadc603fb9383..964c07845a0c0 100644 --- a/packages/flutter_tools/lib/src/android/android_device.dart +++ b/packages/flutter_tools/lib/src/android/android_device.dart @@ -599,12 +599,12 @@ class AndroidDevice extends Device { } final bool traceStartup = platformArgs['trace-startup'] as bool? ?? false; - ProtocolDiscovery? vmServiceDiscovery; + ProtocolDiscovery? observatoryDiscovery; if (debuggingOptions.debuggingEnabled) { - vmServiceDiscovery = ProtocolDiscovery.vmService( + observatoryDiscovery = ProtocolDiscovery.observatory( // Avoid using getLogReader, which returns a singleton instance, because the - // VM Service discovery will dipose at the end. creating a new logger here allows + // observatory discovery will dipose at the end. creating a new logger here allows // logs to be surfaced normally during `flutter drive`. await AdbLogReader.createLogReader( this, @@ -687,13 +687,13 @@ class AndroidDevice extends Device { } // Wait for the service protocol port here. This will complete once the - // device has printed "VM Service is listening on...". - _logger.printTrace('Waiting for VM Service port to be available...'); + // device has printed "Observatory is listening on...". + _logger.printTrace('Waiting for observatory port to be available...'); try { - Uri? vmServiceUri; + Uri? observatoryUri; if (debuggingOptions.buildInfo.isDebug || debuggingOptions.buildInfo.isProfile) { - vmServiceUri = await vmServiceDiscovery?.uri; - if (vmServiceUri == null) { + observatoryUri = await observatoryDiscovery?.uri; + if (observatoryUri == null) { _logger.printError( 'Error waiting for a debug connection: ' 'The log reader stopped unexpectedly', @@ -701,12 +701,12 @@ class AndroidDevice extends Device { return LaunchResult.failed(); } } - return LaunchResult.succeeded(vmServiceUri: vmServiceUri); + return LaunchResult.succeeded(observatoryUri: observatoryUri); } on Exception catch (error) { _logger.printError('Error waiting for a debug connection: $error'); return LaunchResult.failed(); } finally { - await vmServiceDiscovery?.cancel(); + await observatoryDiscovery?.cancel(); } } diff --git a/packages/flutter_tools/lib/src/base/dds.dart b/packages/flutter_tools/lib/src/base/dds.dart index eba8d3875c99e..c7fe0fad83c47 100644 --- a/packages/flutter_tools/lib/src/base/dds.dart +++ b/packages/flutter_tools/lib/src/base/dds.dart @@ -35,7 +35,7 @@ class DartDevelopmentService { final Completer _completer = Completer(); Future startDartDevelopmentService( - Uri vmServiceUri, { + Uri observatoryUri, { required Logger logger, int? hostPort, bool? ipv6, @@ -49,11 +49,11 @@ class DartDevelopmentService { ); logger.printTrace( 'Launching a Dart Developer Service (DDS) instance at $ddsUri, ' - 'connecting to VM service at $vmServiceUri.', + 'connecting to VM service at $observatoryUri.', ); try { _ddsInstance = await ddsLauncherCallback( - vmServiceUri, + observatoryUri, serviceUri: ddsUri, enableAuthCodes: disableServiceAuthCodes != true, ipv6: ipv6 ?? false, diff --git a/packages/flutter_tools/lib/src/build_info.dart b/packages/flutter_tools/lib/src/build_info.dart index 1df9fba756da4..db7d729a1387a 100644 --- a/packages/flutter_tools/lib/src/build_info.dart +++ b/packages/flutter_tools/lib/src/build_info.dart @@ -394,16 +394,16 @@ class BuildMode { throw ArgumentError('$value is not a supported build mode'); } - /// Built in JIT mode with no optimizations, enabled asserts, and a VM service. + /// Built in JIT mode with no optimizations, enabled asserts, and an observatory. static const BuildMode debug = BuildMode._('debug'); - /// Built in AOT mode with some optimizations and a VM service. + /// Built in AOT mode with some optimizations and an observatory. static const BuildMode profile = BuildMode._('profile'); - /// Built in AOT mode with all optimizations and no VM service. + /// Built in AOT mode with all optimizations and no observatory. static const BuildMode release = BuildMode._('release'); - /// Built in JIT mode with all optimizations and no VM service. + /// Built in JIT mode with all optimizations and no observatory. static const BuildMode jitRelease = BuildMode._('jit_release'); static const List values = [ diff --git a/packages/flutter_tools/lib/src/commands/attach.dart b/packages/flutter_tools/lib/src/commands/attach.dart index 6469f29098272..438681b5d9966 100644 --- a/packages/flutter_tools/lib/src/commands/attach.dart +++ b/packages/flutter_tools/lib/src/commands/attach.dart @@ -56,7 +56,7 @@ import '../vmservice.dart'; /// ``` /// $ flutter attach /// ``` -/// As soon as a new VM Service is detected the command attaches to it and +/// As soon as a new observatory is detected the command attaches to it and /// enables hot reloading. /// /// To attach to a flutter mod running on a fuchsia device, `--module` must @@ -97,18 +97,18 @@ class AttachCommand extends FlutterCommand { ..addOption( 'debug-port', hide: !verboseHelp, - help: '(deprecated) Device port where the Dart VM Service is listening. Requires ' + help: '(deprecated) Device port where the observatory is listening. Requires ' '"--disable-service-auth-codes" to also be provided to the Flutter ' 'application at launch, otherwise this command will fail to connect to ' 'the application. In general, "--debug-url" should be used instead.', )..addOption( 'debug-url', aliases: [ 'debug-uri' ], // supported for historical reasons - help: 'The URL at which the Dart VM Service is listening.', + help: 'The URL at which the observatory is listening.', )..addOption( 'app-id', help: 'The package name (Android) or bundle identifier (iOS) for the app. ' - 'This can be specified to avoid being prompted if multiple Dart VM Service ports ' + 'This can be specified to avoid being prompted if multiple observatory ports ' 'are advertised.\n' 'If you have multiple devices or emulators running, you should include the ' 'device hostname as well, e.g. "com.example.myApp@my-iphone".\n' @@ -169,7 +169,7 @@ For Fuchsia, the module name must be provided, e.g. `$flutter attach --module=mod_name`. This can be called either before or after the application is started. -If the app or module is already running and the specific vmService port is +If the app or module is already running and the specific observatory port is known, it can be explicitly provided to attach via the command-line, e.g. `$ flutter attach --debug-port 12345`'''; @@ -225,10 +225,10 @@ known, it can be explicitly provided to attach via the command-line, e.g. 'the value of --ipv6 on its own.', ); } - if (debugPort == null && debugUri == null && argResults!.wasParsed(FlutterCommand.vmServicePortOption)) { + if (debugPort == null && debugUri == null && argResults!.wasParsed(FlutterCommand.observatoryPortOption)) { throwToolExit( 'When the --debug-port or --debug-url is unknown, this command does not use ' - 'the value of --vm-service-port.', + 'the value of --observatory-port.', ); } if (debugPort != null && debugUri != null) { @@ -281,7 +281,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. ) : null; - Stream? vmServiceUri; + Stream? observatoryUri; bool usesIpv6 = ipv6!; final String ipv6Loopback = InternetAddress.loopbackIPv6.address; final String ipv4Loopback = InternetAddress.loopbackIPv4.address; @@ -298,7 +298,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. FuchsiaIsolateDiscoveryProtocol? isolateDiscoveryProtocol; try { isolateDiscoveryProtocol = device.getIsolateDiscoveryProtocol(module); - vmServiceUri = Stream.value(await isolateDiscoveryProtocol.uri).asBroadcastStream(); + observatoryUri = Stream.value(await isolateDiscoveryProtocol.uri).asBroadcastStream(); } on Exception { isolateDiscoveryProtocol?.dispose(); final List ports = device.portForwarder.forwardedPorts.toList(); @@ -351,7 +351,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. Future? protocolDiscoveryFuture; if (compatibleWithProtocolDiscovery) { - final ProtocolDiscovery vmServiceDiscovery = ProtocolDiscovery.vmService( + final ProtocolDiscovery vmServiceDiscovery = ProtocolDiscovery.observatory( device.getLogReader(), portForwarder: device.portForwarder, ipv6: ipv6!, @@ -372,14 +372,14 @@ known, it can be explicitly provided to attach via the command-line, e.g. } discoveryStatus.stop(); - vmServiceUri = foundUrl == null + observatoryUri = foundUrl == null ? null : Stream.value(foundUrl).asBroadcastStream(); } // If MDNS discovery fails or we're not on iOS, fallback to ProtocolDiscovery. - if (vmServiceUri == null) { - final ProtocolDiscovery vmServiceDiscovery = - ProtocolDiscovery.vmService( + if (observatoryUri == null) { + final ProtocolDiscovery observatoryDiscovery = + ProtocolDiscovery.observatory( // If it's an Android device, attaching relies on past log searching // to find the service protocol. await device.getLogReader(includePastLogs: device is AndroidDevice), @@ -390,12 +390,12 @@ known, it can be explicitly provided to attach via the command-line, e.g. logger: _logger, ); _logger.printStatus('Waiting for a connection from Flutter on ${device.name}...'); - vmServiceUri = vmServiceDiscovery.uris; + observatoryUri = observatoryDiscovery.uris; // Determine ipv6 status from the scanned logs. - usesIpv6 = vmServiceDiscovery.ipv6; + usesIpv6 = observatoryDiscovery.ipv6; } } else { - vmServiceUri = Stream + observatoryUri = Stream .fromFuture( buildVMServiceUri( device, @@ -413,7 +413,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. int? result; if (daemon != null) { final ResidentRunner runner = await createResidentRunner( - vmServiceUris: vmServiceUri, + observatoryUris: observatoryUri, device: device, flutterProject: flutterProject, usesIpv6: usesIpv6, @@ -446,7 +446,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. } while (true) { final ResidentRunner runner = await createResidentRunner( - vmServiceUris: vmServiceUri, + observatoryUris: observatoryUri, device: device, flutterProject: flutterProject, usesIpv6: usesIpv6, @@ -476,7 +476,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. } terminalHandler?.stop(); assert(result != null); - if (runner.exited || !runner.isWaitingForVmService) { + if (runner.exited || !runner.isWaitingForObservatory) { break; } _logger.printStatus('Waiting for a new connection from Flutter on ${device.name}...'); @@ -495,7 +495,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. } Future createResidentRunner({ - required Stream vmServiceUris, + required Stream observatoryUris, required Device device, required FlutterProject flutterProject, required bool usesIpv6, @@ -510,7 +510,7 @@ known, it can be explicitly provided to attach via the command-line, e.g. userIdentifier: userIdentifier, platform: _platform, ); - flutterDevice.vmServiceUris = vmServiceUris; + flutterDevice.observatoryUris = observatoryUris; final List flutterDevices = [flutterDevice]; final DebuggingOptions debuggingOptions = DebuggingOptions.enabled( buildInfo, diff --git a/packages/flutter_tools/lib/src/commands/custom_devices.dart b/packages/flutter_tools/lib/src/commands/custom_devices.dart index cc54bf14a757f..40dc89ca849cc 100644 --- a/packages/flutter_tools/lib/src/commands/custom_devices.dart +++ b/packages/flutter_tools/lib/src/commands/custom_devices.dart @@ -650,7 +650,7 @@ class CustomDevicesAddCommand extends CustomDevicesCommandBase { description: 'Should the device use port forwarding? ' 'Using port forwarding is the default because it works in all cases, however if your ' 'remote device has a static IP address and you have a way of ' - 'specifying the "--vm-service-host=" engine option, you might prefer ' + 'specifying the "--observatory-host=" engine option, you might prefer ' 'not using port forwarding.', ); diff --git a/packages/flutter_tools/lib/src/commands/daemon.dart b/packages/flutter_tools/lib/src/commands/daemon.dart index 559880e88c95d..e8bf089eab5c4 100644 --- a/packages/flutter_tools/lib/src/commands/daemon.dart +++ b/packages/flutter_tools/lib/src/commands/daemon.dart @@ -1016,9 +1016,7 @@ class DeviceDomain extends Domain { ); return { 'started': result.started, - 'vmServiceUri': result.vmServiceUri?.toString(), - // TODO(bkonyi): remove once clients have migrated to relying on vmServiceUri. - 'observatoryUri': result.vmServiceUri?.toString(), + 'observatoryUri': result.observatoryUri?.toString(), }; } diff --git a/packages/flutter_tools/lib/src/commands/drive.dart b/packages/flutter_tools/lib/src/commands/drive.dart index 379009ac0e1e6..01918fbd728be 100644 --- a/packages/flutter_tools/lib/src/commands/drive.dart +++ b/packages/flutter_tools/lib/src/commands/drive.dart @@ -81,7 +81,7 @@ class DriveCommand extends RunCommandBase { 'running, and "--no-keep-app-running" overrides it.', ) ..addOption('use-existing-app', - help: 'Connect to an already running instance via the given Dart VM Service URL. ' + help: 'Connect to an already running instance via the given observatory URL. ' 'If this option is given, the application will not be automatically started, ' 'and it will only be stopped if "--no-keep-app-running" is explicitly set.', valueHelp: 'url', diff --git a/packages/flutter_tools/lib/src/commands/screenshot.dart b/packages/flutter_tools/lib/src/commands/screenshot.dart index c291acb723411..6152c8ef382c1 100644 --- a/packages/flutter_tools/lib/src/commands/screenshot.dart +++ b/packages/flutter_tools/lib/src/commands/screenshot.dart @@ -15,7 +15,7 @@ import '../vmservice.dart'; const String _kOut = 'out'; const String _kType = 'type'; -const String _kVmServiceUrl = 'vm-service-url'; +const String _kObservatoryUrl = 'observatory-url'; const String _kDeviceType = 'device'; const String _kSkiaType = 'skia'; const String _kRasterizerType = 'rasterizer'; @@ -29,13 +29,13 @@ class ScreenshotCommand extends FlutterCommand { help: 'Location to write the screenshot.', ); argParser.addOption( - _kVmServiceUrl, + _kObservatoryUrl, aliases: [ 'observatory-url' ], // for historical reasons valueHelp: 'URI', - help: 'The VM Service URL to which to connect.\n' + help: 'The Observatory URL to which to connect.\n' 'This is required when "--$_kType" is "$_kSkiaType" or "$_kRasterizerType".\n' - 'To find the VM service URL, use "flutter run" and look for ' - '"A Dart VM Service ... is available at" in the output.', + 'To find the Observatory URL, use "flutter run" and look for ' + '"An Observatory ... is available at" in the output.', ); argParser.addOption( _kType, @@ -46,8 +46,8 @@ class ScreenshotCommand extends FlutterCommand { _kDeviceType: "Delegate to the device's native screenshot capabilities. This " 'screenshots the entire screen currently being displayed (including content ' 'not rendered by Flutter, like the device status bar).', - _kSkiaType: 'Render the Flutter app as a Skia picture. Requires "--$_kVmServiceUrl".', - _kRasterizerType: 'Render the Flutter app using the rasterizer. Requires "--$_kVmServiceUrl."', + _kSkiaType: 'Render the Flutter app as a Skia picture. Requires "--$_kObservatoryUrl".', + _kRasterizerType: 'Render the Flutter app using the rasterizer. Requires "--$_kObservatoryUrl."', }, defaultsTo: _kDeviceType, ); @@ -70,11 +70,11 @@ class ScreenshotCommand extends FlutterCommand { Device? device; - Future _validateOptions(String? screenshotType, String? vmServiceUrl) async { + Future _validateOptions(String? screenshotType, String? observatoryUrl) async { switch (screenshotType) { case _kDeviceType: - if (vmServiceUrl != null) { - throwToolExit('VM Service URI cannot be provided for screenshot type $screenshotType'); + if (observatoryUrl != null) { + throwToolExit('Observatory URI cannot be provided for screenshot type $screenshotType'); } device = await findTargetDevice(); if (device == null) { @@ -85,18 +85,18 @@ class ScreenshotCommand extends FlutterCommand { } break; default: - if (vmServiceUrl == null) { - throwToolExit('VM Service URI must be specified for screenshot type $screenshotType'); + if (observatoryUrl == null) { + throwToolExit('Observatory URI must be specified for screenshot type $screenshotType'); } - if (vmServiceUrl.isEmpty || Uri.tryParse(vmServiceUrl) == null) { - throwToolExit('VM Service URI "$vmServiceUrl" is invalid'); + if (observatoryUrl.isEmpty || Uri.tryParse(observatoryUrl) == null) { + throwToolExit('Observatory URI "$observatoryUrl" is invalid'); } } } @override Future verifyThenRunCommand(String? commandPath) async { - await _validateOptions(stringArgDeprecated(_kType), stringArgDeprecated(_kVmServiceUrl)); + await _validateOptions(stringArgDeprecated(_kType), stringArgDeprecated(_kObservatoryUrl)); return super.verifyThenRunCommand(commandPath); } @@ -150,8 +150,8 @@ class ScreenshotCommand extends FlutterCommand { } Future runSkia(File? outputFile) async { - final Uri vmServiceUrl = Uri.parse(stringArgDeprecated(_kVmServiceUrl)!); - final FlutterVmService vmService = await connectToVmService(vmServiceUrl, logger: globals.logger); + final Uri observatoryUrl = Uri.parse(stringArgDeprecated(_kObservatoryUrl)!); + final FlutterVmService vmService = await connectToVmService(observatoryUrl, logger: globals.logger); final vm_service.Response? skp = await vmService.screenshotSkp(); if (skp == null) { globals.printError( @@ -174,8 +174,8 @@ class ScreenshotCommand extends FlutterCommand { } Future runRasterizer(File? outputFile) async { - final Uri vmServiceUrl = Uri.parse(stringArgDeprecated(_kVmServiceUrl)!); - final FlutterVmService vmService = await connectToVmService(vmServiceUrl, logger: globals.logger); + final Uri observatoryUrl = Uri.parse(stringArgDeprecated(_kObservatoryUrl)!); + final FlutterVmService vmService = await connectToVmService(observatoryUrl, logger: globals.logger); final vm_service.Response? response = await vmService.screenshot(); if (response == null) { globals.printError( diff --git a/packages/flutter_tools/lib/src/commands/test.dart b/packages/flutter_tools/lib/src/commands/test.dart index 99215e3bb38e5..7c5c774c7f7fd 100644 --- a/packages/flutter_tools/lib/src/commands/test.dart +++ b/packages/flutter_tools/lib/src/commands/test.dart @@ -453,7 +453,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts { tags: tags, excludeTags: excludeTags, watcher: watcher, - enableVmService: collector != null || startPaused || boolArgDeprecated('enable-vmservice'), + enableObservatory: collector != null || startPaused || boolArgDeprecated('enable-vmservice'), ipv6: boolArgDeprecated('ipv6'), machine: machine, updateGoldens: boolArgDeprecated('update-goldens'), diff --git a/packages/flutter_tools/lib/src/custom_devices/custom_device.dart b/packages/flutter_tools/lib/src/custom_devices/custom_device.dart index 72853451bfb3c..cfbcf9f67c4cb 100644 --- a/packages/flutter_tools/lib/src/custom_devices/custom_device.dart +++ b/packages/flutter_tools/lib/src/custom_devices/custom_device.dart @@ -309,7 +309,7 @@ class CustomDeviceAppSession { 'purge-persistent-cache=true', if (debuggingOptions.debuggingEnabled) ...[ if (debuggingOptions.deviceVmServicePort != null) - 'vm-service-port=${debuggingOptions.deviceVmServicePort}', + 'observatory-port=${debuggingOptions.deviceVmServicePort}', if (debuggingOptions.buildInfo.isDebug) ...[ 'enable-checked-mode=true', 'verify-entry-points=true', @@ -374,7 +374,7 @@ class CustomDeviceAppSession { assert(_process == null); _process = process; - final ProtocolDiscovery discovery = ProtocolDiscovery.vmService( + final ProtocolDiscovery discovery = ProtocolDiscovery.observatory( logReader, portForwarder: _device._config.usesPortForwarding ? _device.portForwarder : null, logger: _logger, @@ -388,14 +388,14 @@ class CustomDeviceAppSession { // in the same microtask AFAICT but this way we're on the safe side. logReader.listenToProcessOutput(process); - final Uri? vmServiceUri = await discovery.uri; + final Uri? observatoryUri = await discovery.uri; await discovery.cancel(); if (_device._config.usesPortForwarding) { - _forwardedHostPort = vmServiceUri?.port; + _forwardedHostPort = observatoryUri?.port; } - return LaunchResult.succeeded(vmServiceUri: vmServiceUri); + return LaunchResult.succeeded(observatoryUri: observatoryUri); } void _maybeUnforwardPort() { diff --git a/packages/flutter_tools/lib/src/debug_adapters/flutter_test_adapter.dart b/packages/flutter_tools/lib/src/debug_adapters/flutter_test_adapter.dart index 22f83d7ec8e1d..3072d1958b180 100644 --- a/packages/flutter_tools/lib/src/debug_adapters/flutter_test_adapter.dart +++ b/packages/flutter_tools/lib/src/debug_adapters/flutter_test_adapter.dart @@ -153,7 +153,7 @@ class FlutterTestDebugAdapter extends FlutterBaseDebugAdapter with TestAdapter { /// Handles the test.processStarted event from Flutter that provides the VM Service URL. void _handleTestStartedProcess(Map params) { - final String? vmServiceUriString = params['vmServiceUri'] as String?; + final String? vmServiceUriString = params['observatoryUri'] as String?; // For no-debug mode, this event may be still sent so ignore it if we know // we're not debugging, or its URI is null. if (!enableDebugger || vmServiceUriString == null) { diff --git a/packages/flutter_tools/lib/src/desktop_device.dart b/packages/flutter_tools/lib/src/desktop_device.dart index 80413654d3b24..ae1df62d0609f 100644 --- a/packages/flutter_tools/lib/src/desktop_device.dart +++ b/packages/flutter_tools/lib/src/desktop_device.dart @@ -152,17 +152,17 @@ abstract class DesktopDevice extends Device { if (debuggingOptions.buildInfo.isRelease == true) { return LaunchResult.succeeded(); } - final ProtocolDiscovery vmServiceDiscovery = ProtocolDiscovery.vmService(_deviceLogReader, + final ProtocolDiscovery observatoryDiscovery = ProtocolDiscovery.observatory(_deviceLogReader, devicePort: debuggingOptions.deviceVmServicePort, hostPort: debuggingOptions.hostVmServicePort, ipv6: ipv6, logger: _logger, ); try { - final Uri? vmServiceUri = await vmServiceDiscovery.uri; - if (vmServiceUri != null) { + final Uri? observatoryUri = await observatoryDiscovery.uri; + if (observatoryUri != null) { onAttached(package, buildInfo, process); - return LaunchResult.succeeded(vmServiceUri: vmServiceUri); + return LaunchResult.succeeded(observatoryUri: observatoryUri); } _logger.printError( 'Error waiting for a debug connection: ' @@ -171,7 +171,7 @@ abstract class DesktopDevice extends Device { } on Exception catch (error) { _logger.printError('Error waiting for a debug connection: $error'); } finally { - await vmServiceDiscovery.cancel(); + await observatoryDiscovery.cancel(); } return LaunchResult.failed(); } @@ -270,7 +270,7 @@ abstract class DesktopDevice extends Device { // tool and the device, usually in debug or profile mode. if (debuggingOptions.debuggingEnabled) { if (debuggingOptions.deviceVmServicePort != null) { - addFlag('vm-service-port=${debuggingOptions.deviceVmServicePort}'); + addFlag('observatory-port=${debuggingOptions.deviceVmServicePort}'); } if (debuggingOptions.buildInfo.isDebug) { addFlag('enable-checked-mode=true'); diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart index ac7ac91fafb74..55ec8dab63e00 100644 --- a/packages/flutter_tools/lib/src/device.dart +++ b/packages/flutter_tools/lib/src/device.dart @@ -933,7 +933,7 @@ class DebuggingOptions { return [ if (enableDartProfiling) '--enable-dart-profiling', if (disableServiceAuthCodes) '--disable-service-auth-codes', - if (disablePortPublication) '--disable-vm-service-publication', + if (disablePortPublication) '--disable-observatory-publication', if (startPaused) '--start-paused', // Wrap dart flags in quotes for physical devices if (environmentType == EnvironmentType.physical && dartVmFlags.isNotEmpty) @@ -960,14 +960,14 @@ class DebuggingOptions { if (platformArgs['trace-startup'] as bool? ?? false) '--trace-startup', if (enableImpeller) '--enable-impeller', if (environmentType == EnvironmentType.physical && deviceVmServicePort != null) - '--vm-service-port=$deviceVmServicePort', + '--observatory-port=$deviceVmServicePort', // The simulator "device" is actually on the host machine so no ports will be forwarded. // Use the suggested host port. if (environmentType == EnvironmentType.simulator && hostVmServicePort != null) - '--vm-service-port=$hostVmServicePort', - // Tell the VM service to listen on all interfaces, don't restrict to the loopback. + '--observatory-port=$hostVmServicePort', + // Tell the observatory to listen on all interfaces, don't restrict to the loopback. if (interfaceType == IOSDeviceConnectionInterface.network) - '--vm-service-host=${ipv6 ? '::0' : '0.0.0.0'}', + '--observatory-host=${ipv6 ? '::0' : '0.0.0.0'}', ]; } @@ -1066,21 +1066,21 @@ class DebuggingOptions { } class LaunchResult { - LaunchResult.succeeded({ this.vmServiceUri }) : started = true; + LaunchResult.succeeded({ this.observatoryUri }) : started = true; LaunchResult.failed() : started = false, - vmServiceUri = null; + observatoryUri = null; - bool get hasVmService => vmServiceUri != null; + bool get hasObservatory => observatoryUri != null; final bool started; - final Uri? vmServiceUri; + final Uri? observatoryUri; @override String toString() { final StringBuffer buf = StringBuffer('started=$started'); - if (vmServiceUri != null) { - buf.write(', vmService=$vmServiceUri'); + if (observatoryUri != null) { + buf.write(', observatory=$observatoryUri'); } return buf.toString(); } @@ -1109,9 +1109,9 @@ abstract class DeviceLogReader { /// Describes an app running on the device. class DiscoveredApp { - DiscoveredApp(this.id, this.vmServicePort); + DiscoveredApp(this.id, this.observatoryPort); final String id; - final int vmServicePort; + final int observatoryPort; } // An empty device log reader diff --git a/packages/flutter_tools/lib/src/drive/drive_service.dart b/packages/flutter_tools/lib/src/drive/drive_service.dart index b3340db461fe2..30c0d045d89fc 100644 --- a/packages/flutter_tools/lib/src/drive/drive_service.dart +++ b/packages/flutter_tools/lib/src/drive/drive_service.dart @@ -196,7 +196,7 @@ class FlutterDriverService extends DriverService { throwToolExit('Application failed to start. Will not run test. Quitting.', exitCode: 1); } return reuseApplication( - result.vmServiceUri!, + result.observatoryUri!, device, debuggingOptions, ipv6, diff --git a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart index 0f06943745142..60744d4fbea61 100644 --- a/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart +++ b/packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart @@ -52,11 +52,11 @@ Future _kDefaultFuchsiaIsolateDiscoveryConnector(Uri uri) { Future _kDefaultDartDevelopmentServiceStarter( Device device, - Uri vmServiceUri, + Uri observatoryUri, bool disableServiceAuthCodes, ) async { await device.dds.startDartDevelopmentService( - vmServiceUri, + observatoryUri, hostPort: 0, ipv6: true, disableServiceAuthCodes: disableServiceAuthCodes, @@ -458,12 +458,12 @@ class FuchsiaDevice extends Device { globals.printTrace( 'App started in a non-release mode. Setting up vmservice connection.'); - // In a debug or profile build, try to find the vmService uri. + // In a debug or profile build, try to find the observatory uri. final FuchsiaIsolateDiscoveryProtocol discovery = getIsolateDiscoveryProtocol(appName); try { - final Uri vmServiceUri = await discovery.uri; - return LaunchResult.succeeded(vmServiceUri: vmServiceUri); + final Uri observatoryUri = await discovery.uri; + return LaunchResult.succeeded(observatoryUri: observatoryUri); } finally { discovery.dispose(); } @@ -620,7 +620,7 @@ class FuchsiaDevice extends Device { return addr; }(); - /// List the ports currently running a dart vmService. + /// List the ports currently running a dart observatory. Future> servicePorts() async { const String findCommand = 'find /hub -name vmservice-port'; final RunResult findResult = await shell(findCommand); diff --git a/packages/flutter_tools/lib/src/globals.dart b/packages/flutter_tools/lib/src/globals.dart index 596c5a6c41eb2..260eaf56653e4 100644 --- a/packages/flutter_tools/lib/src/globals.dart +++ b/packages/flutter_tools/lib/src/globals.dart @@ -284,4 +284,5 @@ PreRunValidator get preRunValidator => context.get() ?? const N const String kDefaultFrameworkChannel = 'master'; // Used to build RegExp instances which can detect the VM service message. -final RegExp kVMServiceMessageRegExp = RegExp(r'The Dart VM service is listening on ((http|//)[a-zA-Z0-9:/=_\-\.\[\]]+)'); +const String kServicePrefixRegExp = '(?:Observatory|The Dart VM service is)'; +final RegExp kVMServiceMessageRegExp = RegExp(kServicePrefixRegExp + r' listening on ((http|//)[a-zA-Z0-9:/=_\-\.\[\]]+)'); diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart index 00db24a0c1e63..c58de37a6bdad 100644 --- a/packages/flutter_tools/lib/src/ios/devices.dart +++ b/packages/flutter_tools/lib/src/ios/devices.dart @@ -357,10 +357,10 @@ class IOSDevice extends Device { 'Installing and launching...', ); try { - ProtocolDiscovery? vmServiceDiscovery; + ProtocolDiscovery? observatoryDiscovery; int installationResult = 1; if (debuggingOptions.debuggingEnabled) { - _logger.printTrace('Debugging is enabled, connecting to vmService'); + _logger.printTrace('Debugging is enabled, connecting to observatory'); final DeviceLogReader deviceLogReader = getLogReader(app: package); // If the device supports syslog reading, prefer launching the app without @@ -379,7 +379,7 @@ class IOSDevice extends Device { } } // Don't port foward if debugging with a network device. - vmServiceDiscovery = ProtocolDiscovery.vmService( + observatoryDiscovery = ProtocolDiscovery.observatory( deviceLogReader, portForwarder: interfaceType == IOSDeviceConnectionInterface.network ? null : portForwarder, hostPort: debuggingOptions.hostVmServicePort, @@ -435,7 +435,7 @@ class IOSDevice extends Device { Uri? localUri; if (interfaceType == IOSDeviceConnectionInterface.network) { // Wait for Dart VM Service to start up. - final Uri? serviceURL = await vmServiceDiscovery?.uri; + final Uri? serviceURL = await observatoryDiscovery?.uri; if (serviceURL == null) { await iosDeployDebugger?.stopAndDumpBacktrace(); return LaunchResult.failed(); @@ -463,14 +463,14 @@ class IOSDevice extends Device { mDNSLookupTimer.cancel(); } else { - localUri = await vmServiceDiscovery?.uri; + localUri = await observatoryDiscovery?.uri; } timer.cancel(); if (localUri == null) { await iosDeployDebugger?.stopAndDumpBacktrace(); return LaunchResult.failed(); } - return LaunchResult.succeeded(vmServiceUri: localUri); + return LaunchResult.succeeded(observatoryUri: localUri); } on ProcessException catch (e) { await iosDeployDebugger?.stopAndDumpBacktrace(); _logger.printError(e.message); diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index c4b852a61069b..1c9bf39fae94a 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -450,9 +450,9 @@ class IOSSimulator extends Device { platformArgs, ); - ProtocolDiscovery? vmServiceDiscovery; + ProtocolDiscovery? observatoryDiscovery; if (debuggingOptions.debuggingEnabled) { - vmServiceDiscovery = ProtocolDiscovery.vmService( + observatoryDiscovery = ProtocolDiscovery.observatory( getLogReader(app: package), ipv6: ipv6, hostPort: debuggingOptions.hostVmServicePort, @@ -485,13 +485,13 @@ class IOSSimulator extends Device { } // Wait for the service protocol port here. This will complete once the - // device has printed "Dart VM Service is listening on..." - globals.printTrace('Waiting for VM Service port to be available...'); + // device has printed "Observatory is listening on..." + globals.printTrace('Waiting for observatory port to be available...'); try { - final Uri? deviceUri = await vmServiceDiscovery?.uri; + final Uri? deviceUri = await observatoryDiscovery?.uri; if (deviceUri != null) { - return LaunchResult.succeeded(vmServiceUri: deviceUri); + return LaunchResult.succeeded(observatoryUri: deviceUri); } globals.printError( 'Error waiting for a debug connection: ' @@ -500,7 +500,7 @@ class IOSSimulator extends Device { } on Exception catch (error) { globals.printError('Error waiting for a debug connection: $error'); } finally { - await vmServiceDiscovery?.cancel(); + await observatoryDiscovery?.cancel(); } return LaunchResult.failed(); } diff --git a/packages/flutter_tools/lib/src/macos/application_package.dart b/packages/flutter_tools/lib/src/macos/application_package.dart index f022cf0cfacc0..3debf609f6267 100644 --- a/packages/flutter_tools/lib/src/macos/application_package.dart +++ b/packages/flutter_tools/lib/src/macos/application_package.dart @@ -29,7 +29,7 @@ abstract class MacOSApp extends ApplicationPackage { /// `applicationBinary` is the path to the framework directory created by an /// Xcode build. By default, this is located under /// "~/Library/Developer/Xcode/DerivedData/" and contains an executable - /// which is expected to start the application and send the vmService + /// which is expected to start the application and send the observatory /// port over stdout. static MacOSApp? fromPrebuiltApp(FileSystemEntity applicationBinary) { final _BundleInfo? bundleInfo = _executableFromBundle(applicationBinary); diff --git a/packages/flutter_tools/lib/src/mdns_discovery.dart b/packages/flutter_tools/lib/src/mdns_discovery.dart index bff5d06bb5390..c4b1f8f42155e 100644 --- a/packages/flutter_tools/lib/src/mdns_discovery.dart +++ b/packages/flutter_tools/lib/src/mdns_discovery.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:async'; - import 'package:meta/meta.dart'; import 'package:multicast_dns/multicast_dns.dart'; @@ -41,7 +39,7 @@ class MDnsVmServiceDiscovery { final Usage _flutterUsage; @visibleForTesting - static const String dartVmServiceName = '_dartVmService._tcp.local'; + static const String dartVmServiceName = '_dartobservatory._tcp.local'; static MDnsVmServiceDiscovery? get instance => context.get(); diff --git a/packages/flutter_tools/lib/src/preview_device.dart b/packages/flutter_tools/lib/src/preview_device.dart index aff36eebc30ae..9c2a7bb6cda09 100644 --- a/packages/flutter_tools/lib/src/preview_device.dart +++ b/packages/flutter_tools/lib/src/preview_device.dart @@ -139,16 +139,16 @@ class PreviewDevice extends Device { _process = process; _logReader.initializeProcess(process); - final ProtocolDiscovery vmServiceDiscovery = ProtocolDiscovery.vmService(_logReader, + final ProtocolDiscovery observatoryDiscovery = ProtocolDiscovery.observatory(_logReader, devicePort: debuggingOptions.deviceVmServicePort, hostPort: debuggingOptions.hostVmServicePort, ipv6: ipv6, logger: _logger, ); try { - final Uri? vmServiceUri = await vmServiceDiscovery.uri; - if (vmServiceUri != null) { - return LaunchResult.succeeded(vmServiceUri: vmServiceUri); + final Uri? observatoryUri = await observatoryDiscovery.uri; + if (observatoryUri != null) { + return LaunchResult.succeeded(observatoryUri: observatoryUri); } _logger.printError( 'Error waiting for a debug connection: ' @@ -157,7 +157,7 @@ class PreviewDevice extends Device { } on Exception catch (error) { _logger.printError('Error waiting for a debug connection: $error'); } finally { - await vmServiceDiscovery.cancel(); + await observatoryDiscovery.cancel(); } return LaunchResult.failed(); } diff --git a/packages/flutter_tools/lib/src/protocol_discovery.dart b/packages/flutter_tools/lib/src/protocol_discovery.dart index 197346c240b10..a220863ef854b 100644 --- a/packages/flutter_tools/lib/src/protocol_discovery.dart +++ b/packages/flutter_tools/lib/src/protocol_discovery.dart @@ -29,7 +29,7 @@ class ProtocolDiscovery { ); } - factory ProtocolDiscovery.vmService( + factory ProtocolDiscovery.observatory( DeviceLogReader logReader, { DevicePortForwarder? portForwarder, Duration? throttleDuration, @@ -38,10 +38,10 @@ class ProtocolDiscovery { required bool ipv6, required Logger logger, }) { - const String kVmServiceService = 'VM Service'; + const String kObservatoryService = 'Observatory'; return ProtocolDiscovery._( logReader, - kVmServiceService, + kObservatoryService, portForwarder: portForwarder, throttleDuration: throttleDuration ?? const Duration(milliseconds: 200), hostPort: hostPort, @@ -59,7 +59,7 @@ class ProtocolDiscovery { final bool ipv6; final Logger _logger; - /// The time to wait before forwarding a new VM Service URIs from [logReader]. + /// The time to wait before forwarding a new observatory URIs from [logReader]. final Duration throttleDuration; StreamSubscription? _deviceLogSubscription; @@ -81,12 +81,12 @@ class ProtocolDiscovery { /// The discovered service URLs. /// - /// When a new VM Service URL: is available in [logReader], + /// When a new observatory URL: is available in [logReader], /// the URLs are forwarded at most once every [throttleDuration]. /// Returns when no event has been observed for [throttleTimeout]. /// /// Port forwarding is only attempted when this is invoked, - /// for each VM Service URL in the stream. + /// for each observatory URL in the stream. Stream get uris { final Stream uriStream = _uriStreamController.stream .transform(_throttle( @@ -107,7 +107,7 @@ class ProtocolDiscovery { return globals.kVMServiceMessageRegExp.firstMatch(line); } - Uri? _getVmServiceUri(String line) { + Uri? _getObservatoryUri(String line) { final Match? match = _getPatternMatch(line); if (match != null) { return Uri.parse(match[1]!); @@ -118,7 +118,7 @@ class ProtocolDiscovery { void _handleLine(String line) { Uri? uri; try { - uri = _getVmServiceUri(line); + uri = _getObservatoryUri(line); } on FormatException catch (error, stackTrace) { _uriStreamController.addError(error, stackTrace); } @@ -126,7 +126,7 @@ class ProtocolDiscovery { return; } if (devicePort != null && uri.port != devicePort) { - _logger.printTrace('skipping potential VM Service $uri due to device port mismatch'); + _logger.printTrace('skipping potential observatory $uri due to device port mismatch'); return; } _uriStreamController.add(uri); diff --git a/packages/flutter_tools/lib/src/proxied_devices/devices.dart b/packages/flutter_tools/lib/src/proxied_devices/devices.dart index 63d005eb434e2..f9a98cce50efc 100644 --- a/packages/flutter_tools/lib/src/proxied_devices/devices.dart +++ b/packages/flutter_tools/lib/src/proxied_devices/devices.dart @@ -245,12 +245,12 @@ class ProxiedDevice extends Device { 'userIdentifier': userIdentifier, })); final bool started = _cast(result['started']); - final String? vmServiceUriStr = _cast(result['vmServiceUri']); - final Uri? vmServiceUri = vmServiceUriStr == null ? null : Uri.parse(vmServiceUriStr); + final String? observatoryUriStr = _cast(result['observatoryUri']); + final Uri? observatoryUri = observatoryUriStr == null ? null : Uri.parse(observatoryUriStr); if (started) { - if (vmServiceUri != null) { - final int hostPort = await proxiedPortForwarder.forward(vmServiceUri.port); - return LaunchResult.succeeded(vmServiceUri: vmServiceUri.replace(port: hostPort)); + if (observatoryUri != null) { + final int hostPort = await proxiedPortForwarder.forward(observatoryUri.port); + return LaunchResult.succeeded(observatoryUri: observatoryUri.replace(port: hostPort)); } else { return LaunchResult.succeeded(); } diff --git a/packages/flutter_tools/lib/src/resident_devtools_handler.dart b/packages/flutter_tools/lib/src/resident_devtools_handler.dart index 2dc0aaef1aea5..0d210fd46101b 100644 --- a/packages/flutter_tools/lib/src/resident_devtools_handler.dart +++ b/packages/flutter_tools/lib/src/resident_devtools_handler.dart @@ -114,7 +114,7 @@ class FlutterResidentDevtoolsHandler implements ResidentDevtoolsHandler { if (_residentRunner.reportedDebuggers) { // Since the DevTools only just became available, we haven't had a chance to // report their URLs yet. Do so now. - _residentRunner.printDebuggerList(includeVmService: false); + _residentRunner.printDebuggerList(includeObservatory: false); } } diff --git a/packages/flutter_tools/lib/src/resident_runner.dart b/packages/flutter_tools/lib/src/resident_runner.dart index 68444238e9f8e..b19b77128b213 100644 --- a/packages/flutter_tools/lib/src/resident_runner.dart +++ b/packages/flutter_tools/lib/src/resident_runner.dart @@ -224,21 +224,21 @@ class FlutterDevice { final DevelopmentSceneImporter? developmentSceneImporter; DevFSWriter? devFSWriter; - Stream? vmServiceUris; + Stream? observatoryUris; FlutterVmService? vmService; DevFS? devFS; ApplicationPackage? package; // ignore: cancel_subscriptions StreamSubscription? _loggingSubscription; - bool? _isListeningForVmServiceUri; + bool? _isListeningForObservatoryUri; - /// Whether the stream [vmServiceUris] is still open. - bool get isWaitingForVmService => _isListeningForVmServiceUri ?? false; + /// Whether the stream [observatoryUris] is still open. + bool get isWaitingForObservatory => _isListeningForObservatoryUri ?? false; /// If the [reloadSources] parameter is not null the 'reloadSources' service /// will be registered. /// The 'reloadSources' service can be used by other Service Protocol clients - /// connected to the VM (e.g. VmService) to request a reload of the source + /// connected to the VM (e.g. Observatory) to request a reload of the source /// code of the running application (a.k.a. HotReload). /// The 'compileExpression' service can be used to compile user-provided /// expressions requested during debugging of the application. @@ -262,29 +262,29 @@ class FlutterDevice { late StreamSubscription subscription; bool isWaitingForVm = false; - subscription = vmServiceUris!.listen((Uri? vmServiceUri) async { + subscription = observatoryUris!.listen((Uri? observatoryUri) async { // FYI, this message is used as a sentinel in tests. - globals.printTrace('Connecting to service protocol: $vmServiceUri'); + globals.printTrace('Connecting to service protocol: $observatoryUri'); isWaitingForVm = true; bool existingDds = false; FlutterVmService? service; if (enableDds) { void handleError(Exception e, StackTrace st) { - globals.printTrace('Fail to connect to service protocol: $vmServiceUri: $e'); + globals.printTrace('Fail to connect to service protocol: $observatoryUri: $e'); if (!completer.isCompleted) { - completer.completeError('failed to connect to $vmServiceUri', st); + completer.completeError('failed to connect to $observatoryUri', st); } } - // First check if the VM service is actually listening on vmServiceUri as + // First check if the VM service is actually listening on observatoryUri as // this may not be the case when scraping logcat for URIs. If this URI is // from an old application instance, we shouldn't try and start DDS. try { - service = await connectToVmService(vmServiceUri!, logger: globals.logger); + service = await connectToVmService(observatoryUri!, logger: globals.logger); await service.dispose(); } on Exception catch (exception) { - globals.printTrace('Fail to connect to service protocol: $vmServiceUri: $exception'); - if (!completer.isCompleted && !_isListeningForVmServiceUri!) { - completer.completeError('failed to connect to $vmServiceUri'); + globals.printTrace('Fail to connect to service protocol: $observatoryUri: $exception'); + if (!completer.isCompleted && !_isListeningForObservatoryUri!) { + completer.completeError('failed to connect to $observatoryUri'); } return; } @@ -294,7 +294,7 @@ class FlutterDevice { // attaching to a VM service with existing clients, etc.). try { await device!.dds.startDartDevelopmentService( - vmServiceUri, + observatoryUri, hostPort: ddsPort, ipv6: ipv6, disableServiceAuthCodes: disableServiceAuthCodes, @@ -324,7 +324,7 @@ class FlutterDevice { service = await Future.any( >[ connectToVmService( - enableDds ? (device!.dds.uri ?? vmServiceUri!): vmServiceUri!, + enableDds ? (device!.dds.uri ?? observatoryUri!): observatoryUri!, reloadSources: reloadSources, restart: restart, compileExpression: compileExpression, @@ -338,30 +338,30 @@ class FlutterDevice { ] ) as FlutterVmService?; } on Exception catch (exception) { - globals.printTrace('Fail to connect to service protocol: $vmServiceUri: $exception'); - if (!completer.isCompleted && !_isListeningForVmServiceUri!) { - completer.completeError('failed to connect to $vmServiceUri'); + globals.printTrace('Fail to connect to service protocol: $observatoryUri: $exception'); + if (!completer.isCompleted && !_isListeningForObservatoryUri!) { + completer.completeError('failed to connect to $observatoryUri'); } return; } if (completer.isCompleted) { return; } - globals.printTrace('Successfully connected to service protocol: $vmServiceUri'); + globals.printTrace('Successfully connected to service protocol: $observatoryUri'); vmService = service; (await device!.getLogReader(app: package)).connectedVMService = vmService; completer.complete(); await subscription.cancel(); }, onError: (dynamic error) { - globals.printTrace('Fail to handle VM Service URI: $error'); + globals.printTrace('Fail to handle observatory URI: $error'); }, onDone: () { - _isListeningForVmServiceUri = false; + _isListeningForObservatoryUri = false; if (!completer.isCompleted && !isWaitingForVm) { completer.completeError(Exception('connection to device ended too early')); } }); - _isListeningForVmServiceUri = true; + _isListeningForObservatoryUri = true; return completer.future; } @@ -471,12 +471,12 @@ class FlutterDevice { await stopEchoingDeviceLog(); return 2; } - if (result.hasVmService) { - vmServiceUris = Stream - .value(result.vmServiceUri) + if (result.hasObservatory) { + observatoryUris = Stream + .value(result.observatoryUri) .asBroadcastStream(); } else { - vmServiceUris = const Stream + observatoryUris = const Stream .empty() .asBroadcastStream(); } @@ -536,12 +536,12 @@ class FlutterDevice { await stopEchoingDeviceLog(); return 2; } - if (result.hasVmService) { - vmServiceUris = Stream - .value(result.vmServiceUri) + if (result.hasObservatory) { + observatoryUris = Stream + .value(result.observatoryUri) .asBroadcastStream(); } else { - vmServiceUris = const Stream + observatoryUris = const Stream .empty() .asBroadcastStream(); } @@ -1131,10 +1131,10 @@ abstract class ResidentRunner extends ResidentHandlers { @override bool hotMode; - /// Returns true if every device is streaming vmService URIs. - bool get isWaitingForVmService { + /// Returns true if every device is streaming observatory URIs. + bool get isWaitingForObservatory { return flutterDevices.every((FlutterDevice? device) { - return device!.isWaitingForVmService; + return device!.isWaitingForObservatory; }); } @@ -1478,7 +1478,7 @@ abstract class ResidentRunner extends ResidentHandlers { bool get reportedDebuggers => _reportedDebuggers; bool _reportedDebuggers = false; - void printDebuggerList({ bool includeVmService = true, bool includeDevtools = true }) { + void printDebuggerList({ bool includeObservatory = true, bool includeDevtools = true }) { final DevToolsServerAddress? devToolsServerAddress = residentDevtoolsHandler!.activeDevToolsServer; if (!residentDevtoolsHandler!.readyToAnnounce) { includeDevtools = false; @@ -1488,10 +1488,10 @@ abstract class ResidentRunner extends ResidentHandlers { if (device!.vmService == null) { continue; } - if (includeVmService) { + if (includeObservatory) { // Caution: This log line is parsed by device lab tests. globals.printStatus( - 'A Dart VM Service on ${device.device!.name} is available at: ' + 'An Observatory debugger and profiler on ${device.device!.name} is available at: ' '${device.vmService!.httpAddress}', ); } diff --git a/packages/flutter_tools/lib/src/run_cold.dart b/packages/flutter_tools/lib/src/run_cold.dart index f8dc2571fb145..a8ba6cfb9cfa8 100644 --- a/packages/flutter_tools/lib/src/run_cold.dart +++ b/packages/flutter_tools/lib/src/run_cold.dart @@ -69,7 +69,7 @@ class ColdRunner extends ResidentRunner { return 1; } - // Connect to the VM Service. + // Connect to observatory. if (debuggingEnabled) { try { await connectToServiceProtocol(allowExistingDdsInstance: false); @@ -93,7 +93,7 @@ class ColdRunner extends ResidentRunner { } } - if (flutterDevices.first.vmServiceUris != null) { + if (flutterDevices.first.observatoryUris != null) { // For now, only support one debugger connection. connectionInfoCompleter?.complete(DebugConnectionInfo( httpUri: flutterDevices.first.vmService!.httpAddress, diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart index a8c8d45a91f08..e8c8955861726 100644 --- a/packages/flutter_tools/lib/src/runner/flutter_command.dart +++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart @@ -139,8 +139,8 @@ abstract class FlutterCommand extends Command { /// Will be `null` until the top-most command has begun execution. static FlutterCommand? get current => context.get(); - /// The option name for a custom VM Service port. - static const String vmServicePortOption = 'vm-service-port'; + /// The option name for a custom observatory port. + static const String observatoryPortOption = 'observatory-port'; /// The option name for a custom DevTools server address. static const String kDevToolsServerAddress = 'devtools-server-address'; @@ -379,15 +379,14 @@ abstract class FlutterCommand extends Command { ); } - /// Adds options for connecting to the Dart VM Service port. + /// Adds options for connecting to the Dart VM observatory port. void usesPortOptions({ required bool verboseHelp }) { - argParser.addOption(vmServicePortOption, - aliases: const ['observatory-port'], + argParser.addOption(observatoryPortOption, help: '(deprecated; use host-vmservice-port instead) ' - 'Listen to the given port for a Dart VM Service connection.\n' + 'Listen to the given port for an observatory debugger connection.\n' 'Specifying port 0 (the default) will find a random free port.\n ' 'if the Dart Development Service (DDS) is enabled, this will not be the port ' - 'of the VmService instance advertised on the command line.', + 'of the Observatory instance advertised on the command line.', hide: !verboseHelp, ); argParser.addOption('device-vmservice-port', @@ -491,19 +490,19 @@ abstract class FlutterCommand extends Command { return ddsEnabled; }(); - bool get _hostVmServicePortProvided => (argResults?.wasParsed('vm-service-port') ?? false) + bool get _hostVmServicePortProvided => (argResults?.wasParsed('observatory-port') ?? false) || (argResults?.wasParsed('host-vmservice-port') ?? false); int _tryParseHostVmservicePort() { - final String? vmServicePort = stringArgDeprecated('vm-service-port'); + final String? observatoryPort = stringArgDeprecated('observatory-port'); final String? hostPort = stringArgDeprecated('host-vmservice-port'); - if (vmServicePort == null && hostPort == null) { - throwToolExit('Invalid port for `--vm-service-port/--host-vmservice-port`'); + if (observatoryPort == null && hostPort == null) { + throwToolExit('Invalid port for `--observatory-port/--host-vmservice-port`'); } try { - return int.parse((vmServicePort ?? hostPort)!); + return int.parse((observatoryPort ?? hostPort)!); } on FormatException catch (error) { - throwToolExit('Invalid port for `--vm-service-port/--host-vmservice-port`: $error'); + throwToolExit('Invalid port for `--observatory-port/--host-vmservice-port`: $error'); } } @@ -529,10 +528,10 @@ abstract class FlutterCommand extends Command { return null; } - /// Gets the vmservice port provided to in the 'vm-service-port' or + /// Gets the vmservice port provided to in the 'observatory-port' or /// 'host-vmservice-port option. /// - /// Only one of "host-vmservice-port" and "vm-service-port" may be + /// Only one of "host-vmservice-port" and "observatory-port" may be /// specified. /// /// If no port is set, returns null. @@ -540,9 +539,9 @@ abstract class FlutterCommand extends Command { if (!_usesPortOption || !_hostVmServicePortProvided) { return null; } - if ((argResults?.wasParsed('vm-service-port') ?? false) + if ((argResults?.wasParsed('observatory-port') ?? false) && (argResults?.wasParsed('host-vmservice-port') ?? false)) { - throwToolExit('Only one of "--vm-service-port" and ' + throwToolExit('Only one of "--observatory-port" and ' '"--host-vmservice-port" may be specified.'); } // If DDS is enabled and no explicit DDS port is provided, use the diff --git a/packages/flutter_tools/lib/src/test/coverage_collector.dart b/packages/flutter_tools/lib/src/test/coverage_collector.dart index 1881fb6473fb0..d41732c94686f 100644 --- a/packages/flutter_tools/lib/src/test/coverage_collector.dart +++ b/packages/flutter_tools/lib/src/test/coverage_collector.dart @@ -100,18 +100,18 @@ class CoverageCollector extends TestWatcher { /// has been run to completion so that all coverage data has been recorded. /// /// The returned [Future] completes when the coverage is collected. - Future collectCoverageIsolate(Uri vmServiceUri) async { - _logMessage('collecting coverage data from $vmServiceUri...'); + Future collectCoverageIsolate(Uri observatoryUri) async { + _logMessage('collecting coverage data from $observatoryUri...'); final Map data = await collect( - vmServiceUri, libraryNames, branchCoverage: branchCoverage); + observatoryUri, libraryNames, branchCoverage: branchCoverage); - _logMessage('($vmServiceUri): collected coverage data; merging...'); + _logMessage('($observatoryUri): collected coverage data; merging...'); _addHitmap(await coverage.HitMap.parseJson( data['coverage'] as List>, packagePath: packageDirectory, checkIgnoredLines: true, )); - _logMessage('($vmServiceUri): done merging coverage data into global coverage map.'); + _logMessage('($observatoryUri): done merging coverage data into global coverage map.'); } /// Collects coverage for the given [Process] using the given `port`. @@ -141,11 +141,11 @@ class CoverageCollector extends TestWatcher { } ); - final Future collectionComplete = testDevice.vmServiceUri - .then((Uri? vmServiceUri) { - _logMessage('collecting coverage data from $testDevice at $vmServiceUri...'); + final Future collectionComplete = testDevice.observatoryUri + .then((Uri? observatoryUri) { + _logMessage('collecting coverage data from $testDevice at $observatoryUri...'); return collect( - vmServiceUri!, libraryNames, serviceOverride: serviceOverride, + observatoryUri!, libraryNames, serviceOverride: serviceOverride, branchCoverage: branchCoverage) .then((Map result) { _logMessage('Collected coverage data.'); diff --git a/packages/flutter_tools/lib/src/test/event_printer.dart b/packages/flutter_tools/lib/src/test/event_printer.dart index 3cc572a5b07af..4c99bf79ffb53 100644 --- a/packages/flutter_tools/lib/src/test/event_printer.dart +++ b/packages/flutter_tools/lib/src/test/event_printer.dart @@ -17,10 +17,10 @@ class EventPrinter extends TestWatcher { final TestWatcher? _parent; @override - void handleStartedDevice(Uri? vmServiceUri) { + void handleStartedDevice(Uri? observatoryUri) { _sendEvent('test.startedProcess', - {'vmServiceUri': vmServiceUri?.toString()}); - _parent?.handleStartedDevice(vmServiceUri); + {'observatoryUri': observatoryUri?.toString()}); + _parent?.handleStartedDevice(observatoryUri); } @override diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index c7a9840b87771..b8cc9d532cabb 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -34,7 +34,7 @@ import 'test_time_recorder.dart'; import 'watcher.dart'; /// The address at which our WebSocket server resides and at which the sky_shell -/// processes will host the VmService server. +/// processes will host the Observatory server. final Map _kHosts = { InternetAddressType.IPv4: InternetAddress.loopbackIPv4, InternetAddressType.IPv6: InternetAddress.loopbackIPv6, @@ -46,13 +46,13 @@ typedef PlatformPluginRegistration = void Function(FlutterPlatform platform); /// /// On systems where each [FlutterPlatform] is only used to run one test suite /// (that is, one Dart file with a `*_test.dart` file name and a single `void -/// main()`), you can set a VM Service port explicitly. +/// main()`), you can set an observatory port explicitly. FlutterPlatform installHook({ TestWrapper testWrapper = const TestWrapper(), required String shellPath, required DebuggingOptions debuggingOptions, TestWatcher? watcher, - bool enableVmService = false, + bool enableObservatory = false, bool machine = false, String? precompiledDillPath, Map? precompiledDillFiles, @@ -68,7 +68,7 @@ FlutterPlatform installHook({ TestTimeRecorder? testTimeRecorder, UriConverter? uriConverter, }) { - assert(enableVmService || (!debuggingOptions.startPaused && debuggingOptions.hostVmServicePort == null)); + assert(enableObservatory || (!debuggingOptions.startPaused && debuggingOptions.hostVmServicePort == null)); // registerPlatformPlugin can be injected for testing since it's not very mock-friendly. platformPluginRegistration ??= (FlutterPlatform platform) { @@ -84,7 +84,7 @@ FlutterPlatform installHook({ debuggingOptions: debuggingOptions, watcher: watcher, machine: machine, - enableVmService: enableVmService, + enableObservatory: enableObservatory, host: _kHosts[serverType], precompiledDillPath: precompiledDillPath, precompiledDillFiles: precompiledDillFiles, @@ -276,7 +276,7 @@ class FlutterPlatform extends PlatformPlugin { required this.shellPath, required this.debuggingOptions, this.watcher, - this.enableVmService, + this.enableObservatory, this.machine, this.host, this.precompiledDillPath, @@ -295,7 +295,7 @@ class FlutterPlatform extends PlatformPlugin { final String shellPath; final DebuggingOptions debuggingOptions; final TestWatcher? watcher; - final bool? enableVmService; + final bool? enableObservatory; final bool? machine; final InternetAddress? host; final String? precompiledDillPath; @@ -357,7 +357,7 @@ class FlutterPlatform extends PlatformPlugin { if (_testCount > 0) { // Fail if there will be a port conflict. if (debuggingOptions.hostVmServicePort != null) { - throwToolExit('installHook() was called with a VM Service port or debugger mode enabled, but then more than one test suite was run.'); + throwToolExit('installHook() was called with an observatory port or debugger mode enabled, but then more than one test suite was run.'); } // Fail if we're passing in a precompiled entry-point. if (precompiledDillPath != null) { @@ -424,7 +424,7 @@ class FlutterPlatform extends PlatformPlugin { processManager: globals.processManager, logger: globals.logger, shellPath: shellPath, - enableVmService: enableVmService!, + enableObservatory: enableObservatory!, machine: machine, debuggingOptions: debuggingOptions, host: host, @@ -512,13 +512,13 @@ class FlutterPlatform extends PlatformPlugin { await Future.any(>[ testDevice.finished, () async { - final Uri? processVmServiceUri = await testDevice.vmServiceUri; - if (processVmServiceUri != null) { - globals.printTrace('test $ourTestCount: VM Service uri is available at $processVmServiceUri'); + final Uri? processObservatoryUri = await testDevice.observatoryUri; + if (processObservatoryUri != null) { + globals.printTrace('test $ourTestCount: Observatory uri is available at $processObservatoryUri'); } else { - globals.printTrace('test $ourTestCount: VM Service uri is not available'); + globals.printTrace('test $ourTestCount: Observatory uri is not available'); } - watcher?.handleStartedDevice(processVmServiceUri); + watcher?.handleStartedDevice(processObservatoryUri); final StreamChannel remoteChannel = await remoteChannelFuture; globals.printTrace('test $ourTestCount: connected to test device, now awaiting test result'); diff --git a/packages/flutter_tools/lib/src/test/flutter_tester_device.dart b/packages/flutter_tools/lib/src/test/flutter_tester_device.dart index 8a39c2d2c7833..9b09f12642d24 100644 --- a/packages/flutter_tools/lib/src/test/flutter_tester_device.dart +++ b/packages/flutter_tools/lib/src/test/flutter_tester_device.dart @@ -36,7 +36,7 @@ class FlutterTesterTestDevice extends TestDevice { required this.logger, required this.shellPath, required this.debuggingOptions, - required this.enableVmService, + required this.enableObservatory, required this.machine, required this.host, required this.testAssetDirectory, @@ -45,8 +45,8 @@ class FlutterTesterTestDevice extends TestDevice { required this.compileExpression, required this.fontConfigManager, required this.uriConverter, - }) : assert(!debuggingOptions.startPaused || enableVmService), - _gotProcessVmServiceUri = enableVmService + }) : assert(!debuggingOptions.startPaused || enableObservatory), + _gotProcessObservatoryUri = enableObservatory ? Completer() : (Completer()..complete()); /// Used for logging to identify the test that is currently being executed. @@ -57,7 +57,7 @@ class FlutterTesterTestDevice extends TestDevice { final Logger logger; final String shellPath; final DebuggingOptions debuggingOptions; - final bool enableVmService; + final bool enableObservatory; final bool? machine; final InternetAddress? host; final String? testAssetDirectory; @@ -67,7 +67,7 @@ class FlutterTesterTestDevice extends TestDevice { final FontConfigManager fontConfigManager; final UriConverter? uriConverter; - final Completer _gotProcessVmServiceUri; + final Completer _gotProcessObservatoryUri; final Completer _exitCode = Completer(); Process? _process; @@ -89,7 +89,7 @@ class FlutterTesterTestDevice extends TestDevice { logger.printTrace('test $id: test harness socket server is running at port:${_server!.port}'); final List command = [ shellPath, - if (enableVmService) ...[ + if (enableObservatory) ...[ // Some systems drive the _FlutterPlatform class in an unusual way, where // only one test file is processed at a time, and the operating // environment hands out specific ports ahead of time in a cooperative @@ -99,12 +99,12 @@ class FlutterTesterTestDevice extends TestDevice { // // I mention this only so that you won't be tempted, as I was, to apply // the obvious simplification to this code and remove this entire feature. - '--vm-service-port=${debuggingOptions.enableDds ? 0 : debuggingOptions.hostVmServicePort }', + '--observatory-port=${debuggingOptions.enableDds ? 0 : debuggingOptions.hostVmServicePort }', if (debuggingOptions.startPaused) '--start-paused', if (debuggingOptions.disableServiceAuthCodes) '--disable-service-auth-codes', ] else - '--disable-vm-service', + '--disable-observatory', if (host!.type == InternetAddressType.IPv6) '--ipv6', if (icudtlPath != null) '--icu-data-file-path=$icudtlPath', '--enable-checked-mode', @@ -154,11 +154,11 @@ class FlutterTesterTestDevice extends TestDevice { logger.printTrace('test $id: Started flutter_tester process at pid ${_process!.pid}'); // Pipe stdout and stderr from the subprocess to our printStatus console. - // We also keep track of what VM Service port the engine used, if any. + // We also keep track of what observatory port the engine used, if any. _pipeStandardStreamsToConsole( process: _process!, - reportVmServiceUri: (Uri detectedUri) async { - assert(!_gotProcessVmServiceUri.isCompleted); + reportObservatoryUri: (Uri detectedUri) async { + assert(!_gotProcessObservatoryUri.isCompleted); assert(debuggingOptions.hostVmServicePort == null || debuggingOptions.hostVmServicePort == detectedUri.port); @@ -194,11 +194,12 @@ class FlutterTesterTestDevice extends TestDevice { if (debuggingOptions.startPaused && !machine!) { logger.printStatus('The test process has been started.'); - logger.printStatus('You can now connect to it using vmService. To connect, load the following Web site in your browser:'); + logger.printStatus('You can now connect to it using observatory. To connect, load the following Web site in your browser:'); logger.printStatus(' $forwardingUri'); logger.printStatus('You should first set appropriate breakpoints, then resume the test in the debugger.'); } - _gotProcessVmServiceUri.complete(forwardingUri); + + _gotProcessObservatoryUri.complete(forwardingUri); }, ); @@ -206,8 +207,8 @@ class FlutterTesterTestDevice extends TestDevice { } @override - Future get vmServiceUri { - return _gotProcessVmServiceUri.future; + Future get observatoryUri { + return _gotProcessObservatoryUri.future; } @override @@ -292,7 +293,7 @@ class FlutterTesterTestDevice extends TestDevice { void _pipeStandardStreamsToConsole({ required Process process, - required Future Function(Uri uri) reportVmServiceUri, + required Future Function(Uri uri) reportObservatoryUri, }) { for (final Stream> stream in >>[ process.stderr, @@ -309,9 +310,9 @@ class FlutterTesterTestDevice extends TestDevice { if (match != null) { try { final Uri uri = Uri.parse(match[1]!); - await reportVmServiceUri(uri); + await reportObservatoryUri(uri); } on Exception catch (error) { - logger.printError('Could not parse shell VM Service port message: $error'); + logger.printError('Could not parse shell observatory port message: $error'); } } else { logger.printStatus('Shell: $line'); diff --git a/packages/flutter_tools/lib/src/test/flutter_web_goldens.dart b/packages/flutter_tools/lib/src/test/flutter_web_goldens.dart index ce7175569ca34..3cc7c893ea75d 100644 --- a/packages/flutter_tools/lib/src/test/flutter_web_goldens.dart +++ b/packages/flutter_tools/lib/src/test/flutter_web_goldens.dart @@ -84,7 +84,7 @@ class TestGoldenComparator { } final List command = [ shellPath!, - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=${_fileSystem.path.join('.dart_tool', 'package_config.json')}', output, diff --git a/packages/flutter_tools/lib/src/test/integration_test_device.dart b/packages/flutter_tools/lib/src/test/integration_test_device.dart index 598bcc7423c80..49930901ceb23 100644 --- a/packages/flutter_tools/lib/src/test/integration_test_device.dart +++ b/packages/flutter_tools/lib/src/test/integration_test_device.dart @@ -35,7 +35,7 @@ class IntegrationTestTestDevice implements TestDevice { ApplicationPackage? _applicationPackage; final Completer _finished = Completer(); - final Completer _gotProcessVmServiceUri = Completer(); + final Completer _gotProcessObservatoryUri = Completer(); /// Starts the device. /// @@ -62,19 +62,19 @@ class IntegrationTestTestDevice implements TestDevice { if (!launchResult.started) { throw TestDeviceException('Unable to start the app on the device.', StackTrace.current); } - final Uri? vmServiceUri = launchResult.vmServiceUri; - if (vmServiceUri == null) { - throw TestDeviceException('The VM Service is not available on the test device.', StackTrace.current); + final Uri? observatoryUri = launchResult.observatoryUri; + if (observatoryUri == null) { + throw TestDeviceException('Observatory is not available on the test device.', StackTrace.current); } // No need to set up the log reader because the logs are captured and // streamed to the package:test_core runner. - _gotProcessVmServiceUri.complete(vmServiceUri); + _gotProcessObservatoryUri.complete(observatoryUri); globals.printTrace('test $id: Connecting to vm service'); final FlutterVmService vmService = await connectToVmService( - vmServiceUri, + observatoryUri, logger: globals.logger, compileExpression: compileExpression, ).timeout( @@ -116,7 +116,7 @@ class IntegrationTestTestDevice implements TestDevice { } @override - Future get vmServiceUri => _gotProcessVmServiceUri.future; + Future get observatoryUri => _gotProcessObservatoryUri.future; @override Future kill() async { diff --git a/packages/flutter_tools/lib/src/test/runner.dart b/packages/flutter_tools/lib/src/test/runner.dart index d8a62d8985dec..02789aa0ea430 100644 --- a/packages/flutter_tools/lib/src/test/runner.dart +++ b/packages/flutter_tools/lib/src/test/runner.dart @@ -30,7 +30,7 @@ abstract class FlutterTestRunner { List plainNames = const [], String? tags, String? excludeTags, - bool enableVmService = false, + bool enableObservatory = false, bool ipv6 = false, bool machine = false, String? precompiledDillPath, @@ -67,7 +67,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner { List plainNames = const [], String? tags, String? excludeTags, - bool enableVmService = false, + bool enableObservatory = false, bool ipv6 = false, bool machine = false, String? precompiledDillPath, @@ -192,7 +192,7 @@ class _FlutterTestRunnerImpl implements FlutterTestRunner { shellPath: shellPath, debuggingOptions: debuggingOptions, watcher: watcher, - enableVmService: enableVmService, + enableObservatory: enableObservatory, machine: machine, serverType: serverType, precompiledDillPath: precompiledDillPath, diff --git a/packages/flutter_tools/lib/src/test/test_device.dart b/packages/flutter_tools/lib/src/test/test_device.dart index 722fe60d74d9f..28ff3641691bf 100644 --- a/packages/flutter_tools/lib/src/test/test_device.dart +++ b/packages/flutter_tools/lib/src/test/test_device.dart @@ -21,8 +21,8 @@ abstract class TestDevice { /// or raw source file. Future> start(String entrypointPath); - /// Should complete with null if the VM Service is not enabled. - Future get vmServiceUri; + /// Should complete with null if the observatory is not enabled. + Future get observatoryUri; /// Terminates the test device. Future kill(); diff --git a/packages/flutter_tools/lib/src/test/watcher.dart b/packages/flutter_tools/lib/src/test/watcher.dart index 55b6d148f659a..028bfecf74652 100644 --- a/packages/flutter_tools/lib/src/test/watcher.dart +++ b/packages/flutter_tools/lib/src/test/watcher.dart @@ -8,9 +8,9 @@ import 'test_device.dart'; abstract class TestWatcher { /// Called after the test device starts. /// - /// If startPaused was true, the caller needs to resume in DevTools to + /// If startPaused was true, the caller needs to resume in Observatory to /// start running the tests. - void handleStartedDevice(Uri? vmServiceUri) { } + void handleStartedDevice(Uri? observatoryUri) { } /// Called after the tests finish but before the test device exits. /// diff --git a/packages/flutter_tools/lib/src/tester/flutter_tester.dart b/packages/flutter_tools/lib/src/tester/flutter_tester.dart index 9dd92068edf42..162370f9f06bc 100644 --- a/packages/flutter_tools/lib/src/tester/flutter_tester.dart +++ b/packages/flutter_tools/lib/src/tester/flutter_tester.dart @@ -174,11 +174,11 @@ class FlutterTesterDevice extends Device { if (debuggingOptions.disableServiceAuthCodes) '--disable-service-auth-codes', if (debuggingOptions.hostVmServicePort != null) - '--vm-service-port=${debuggingOptions.hostVmServicePort}', + '--observatory-port=${debuggingOptions.hostVmServicePort}', applicationKernelFilePath, ]; - ProtocolDiscovery? vmServiceDiscovery; + ProtocolDiscovery? observatoryDiscovery; try { _logger.printTrace(command.join(' ')); _process = await _processManager.start(command, @@ -190,7 +190,7 @@ class FlutterTesterDevice extends Device { return LaunchResult.succeeded(); } - vmServiceDiscovery = ProtocolDiscovery.vmService( + observatoryDiscovery = ProtocolDiscovery.observatory( getLogReader(), hostPort: debuggingOptions.hostVmServicePort, devicePort: debuggingOptions.deviceVmServicePort, @@ -199,9 +199,9 @@ class FlutterTesterDevice extends Device { ); _logReader.initializeProcess(_process!); - final Uri? vmServiceUri = await vmServiceDiscovery.uri; - if (vmServiceUri != null) { - return LaunchResult.succeeded(vmServiceUri: vmServiceUri); + final Uri? observatoryUri = await observatoryDiscovery.uri; + if (observatoryUri != null) { + return LaunchResult.succeeded(observatoryUri: observatoryUri); } _logger.printError( 'Failed to launch $package: ' @@ -210,7 +210,7 @@ class FlutterTesterDevice extends Device { } on Exception catch (error) { _logger.printError('Failed to launch $package: $error'); } finally { - await vmServiceDiscovery?.cancel(); + await observatoryDiscovery?.cancel(); } return LaunchResult.failed(); } diff --git a/packages/flutter_tools/lib/src/tracing.dart b/packages/flutter_tools/lib/src/tracing.dart index 6e43d19d1c6b1..0ed9456cbb354 100644 --- a/packages/flutter_tools/lib/src/tracing.dart +++ b/packages/flutter_tools/lib/src/tracing.dart @@ -120,7 +120,7 @@ class Tracing { } } -/// Download the startup trace information from the given VM Service client and +/// Download the startup trace information from the given observatory client and /// store it to `$output/start_up_info.json`. Future downloadStartupTrace(FlutterVmService vmService, { bool awaitFirstFrame = true, diff --git a/packages/flutter_tools/lib/src/vmservice.dart b/packages/flutter_tools/lib/src/vmservice.dart index f0096a066d287..d37d6119d0de5 100644 --- a/packages/flutter_tools/lib/src/vmservice.dart +++ b/packages/flutter_tools/lib/src/vmservice.dart @@ -73,7 +73,7 @@ abstract class RPCErrorCodes { /// The VM Service Protocol allows clients to register custom services that /// can be invoked by other clients through the service protocol itself. /// -/// Clients like VmService use external 'reloadSources' services, +/// Clients like Observatory use external 'reloadSources' services, /// when available, instead of the VM internal one. This allows these clients to /// invoke Flutter HotReload when connected to a Flutter Application started in /// hot mode. diff --git a/packages/flutter_tools/lib/src/web/web_device.dart b/packages/flutter_tools/lib/src/web/web_device.dart index 9c54bb202d6f3..17a535fe9f2b9 100644 --- a/packages/flutter_tools/lib/src/web/web_device.dart +++ b/packages/flutter_tools/lib/src/web/web_device.dart @@ -153,7 +153,7 @@ abstract class ChromiumDevice extends Device { ); } _logger.sendEvent('app.webLaunchUrl', {'url': url, 'launched': launchChrome}); - return LaunchResult.succeeded(vmServiceUri: Uri.parse(url)); + return LaunchResult.succeeded(observatoryUri: Uri.parse(url)); } @override @@ -474,7 +474,7 @@ class WebServerDevice extends Device { 'Consider using the Chrome or Edge devices for an improved development workflow.' ); _logger.sendEvent('app.webLaunchUrl', {'url': url, 'launched': false}); - return LaunchResult.succeeded(vmServiceUri: url != null ? Uri.parse(url): null); + return LaunchResult.succeeded(observatoryUri: url != null ? Uri.parse(url): null); } @override diff --git a/packages/flutter_tools/static/custom-devices.schema.json b/packages/flutter_tools/static/custom-devices.schema.json index da0a78400d96d..8bac5c0bb14ef 100644 --- a/packages/flutter_tools/static/custom-devices.schema.json +++ b/packages/flutter_tools/static/custom-devices.schema.json @@ -91,14 +91,14 @@ ] }, "runDebug": { - "description": "The command to be invoked to run the app in debug mode. The name of the app to be started is available via the ${appName} string interpolation. Make sure the flutter cmdline output is available via this commands stdout/stderr since the SDK needs the \"VM Service is now listening on ...\" message to function. If the forwardPort command is not specified, the VM Service URL will be connected to as-is, without any port forwarding. In that case you need to make sure it is reachable from your host device, possibly via the \"--vm-service-host=\" engine flag.", + "description": "The command to be invoked to run the app in debug mode. The name of the app to be started is available via the ${appName} string interpolation. Make sure the flutter cmdline output is available via this commands stdout/stderr since the SDK needs the \"Observatory is now listening on ...\" message to function. If the forwardPort command is not specified, the observatory URL will be connected to as-is, without any port forwarding. In that case you need to make sure it is reachable from your host device, possibly via the \"--observatory-host=\" engine flag.", "type": "array", "items": { "type": "string" }, "minItems": 1, "default": [ - "ssh", "pi@raspberrypi", "flutter-pi /tmp/${appName} --vm-service-host=192.168.178.123" + "ssh", "pi@raspberrypi", "flutter-pi /tmp/${appName} --observatory-host=192.168.178.123" ] }, "forwardPort": { diff --git a/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart index 4e716d37a0c59..42d91c6bf8778 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart @@ -118,8 +118,8 @@ void main() { testDeviceManager.devices = [device]; final Completer completer = Completer(); final StreamSubscription loggerSubscription = logger.stream.listen((String message) { - if (message == '[verbose] VM Service URL on device: http://127.0.0.1:$devicePort') { - // The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service. + if (message == '[verbose] Observatory URL on device: http://127.0.0.1:$devicePort') { + // The "Observatory URL on device" message is output by the ProtocolDiscovery when it found the observatory. completer.complete(); } }); @@ -131,7 +131,7 @@ void main() { bool enableDevTools, ) async => 0; hotRunner.exited = false; - hotRunner.isWaitingForVmService = false; + hotRunner.isWaitingForObservatory = false; final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory() ..hotRunner = hotRunner; @@ -186,7 +186,7 @@ void main() { bool enableDevTools, ) async => 0; hotRunner.exited = false; - hotRunner.isWaitingForVmService = false; + hotRunner.isWaitingForObservatory = false; final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory() ..hotRunner = hotRunner; @@ -207,8 +207,8 @@ void main() { expect(portForwarder.hostPort, hostPort); expect(hotRunnerFactory.devices, hasLength(1)); final FlutterDevice flutterDevice = hotRunnerFactory.devices.first; - final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first; - expect(vmServiceUri.toString(), 'http://127.0.0.1:$hostPort/xyz/'); + final Uri? observatoryUri = await flutterDevice.observatoryUris?.first; + expect(observatoryUri.toString(), 'http://127.0.0.1:$hostPort/xyz/'); }, overrides: { FileSystem: () => testFileSystem, ProcessManager: () => FakeProcessManager.any(), @@ -252,7 +252,7 @@ void main() { bool enableDevTools, ) async => 0; hotRunner.exited = false; - hotRunner.isWaitingForVmService = false; + hotRunner.isWaitingForObservatory = false; final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory() ..hotRunner = hotRunner; @@ -274,8 +274,8 @@ void main() { expect(hotRunnerFactory.devices, hasLength(1)); final FlutterDevice flutterDevice = hotRunnerFactory.devices.first; - final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first; - expect(vmServiceUri.toString(), 'http://111.111.111.111:123/xyz/'); + final Uri? observatoryUri = await flutterDevice.observatoryUris?.first; + expect(observatoryUri.toString(), 'http://111.111.111.111:123/xyz/'); }, overrides: { FileSystem: () => testFileSystem, ProcessManager: () => FakeProcessManager.any(), @@ -324,7 +324,7 @@ void main() { bool enableDevTools, ) async => 0; hotRunner.exited = false; - hotRunner.isWaitingForVmService = false; + hotRunner.isWaitingForObservatory = false; final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory() ..hotRunner = hotRunner; @@ -346,8 +346,8 @@ void main() { expect(hotRunnerFactory.devices, hasLength(1)); final FlutterDevice flutterDevice = hotRunnerFactory.devices.first; - final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first; - expect(vmServiceUri.toString(), 'http://111.111.111.111:123/xyz/'); + final Uri? observatoryUri = await flutterDevice.observatoryUris?.first; + expect(observatoryUri.toString(), 'http://111.111.111.111:123/xyz/'); }, overrides: { FileSystem: () => testFileSystem, ProcessManager: () => FakeProcessManager.any(), @@ -400,7 +400,7 @@ void main() { bool enableDevTools, ) async => 0; hotRunner.exited = false; - hotRunner.isWaitingForVmService = false; + hotRunner.isWaitingForObservatory = false; final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory() ..hotRunner = hotRunner; @@ -422,8 +422,8 @@ void main() { expect(hotRunnerFactory.devices, hasLength(1)); final FlutterDevice flutterDevice = hotRunnerFactory.devices.first; - final Uri? vmServiceUri = await flutterDevice.vmServiceUris?.first; - expect(vmServiceUri.toString(), 'http://111.111.111.111:123/xyz/'); + final Uri? observatoryUri = await flutterDevice.observatoryUris?.first; + expect(observatoryUri.toString(), 'http://111.111.111.111:123/xyz/'); }, overrides: { FileSystem: () => testFileSystem, ProcessManager: () => FakeProcessManager.any(), @@ -460,7 +460,7 @@ void main() { ), }); - testUsingContext('finds VM Service port and forwards', () async { + testUsingContext('finds observatory port and forwards', () async { device.onGetLogReader = () { fakeLogReader.addLine('Foo'); fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort'); @@ -469,8 +469,8 @@ void main() { testDeviceManager.devices = [device]; final Completer completer = Completer(); final StreamSubscription loggerSubscription = logger.stream.listen((String message) { - if (message == '[verbose] VM Service URL on device: http://127.0.0.1:$devicePort') { - // The "VM Service URL on device" message is output by the ProtocolDiscovery when it found the VM Service. + if (message == '[verbose] Observatory URL on device: http://127.0.0.1:$devicePort') { + // The "Observatory URL on device" message is output by the ProtocolDiscovery when it found the observatory. completer.complete(); } }); @@ -499,7 +499,7 @@ void main() { DeviceManager: () => testDeviceManager, }); - testUsingContext('Fails with tool exit on bad VmService uri', () async { + testUsingContext('Fails with tool exit on bad Observatory uri', () async { device.onGetLogReader = () { fakeLogReader.addLine('Foo'); fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort'); @@ -545,7 +545,7 @@ void main() { bool enableDevTools, ) async => 0; hotRunner.exited = false; - hotRunner.isWaitingForVmService = false; + hotRunner.isWaitingForObservatory = false; final FakeHotRunnerFactory hotRunnerFactory = FakeHotRunnerFactory() ..hotRunner = hotRunner; @@ -618,7 +618,7 @@ void main() { DeviceManager: () => testDeviceManager, },); - testUsingContext('exits when vm-service-port is specified and debug-port is not', () async { + testUsingContext('exits when observatory-port is specified and debug-port is not', () async { device.onGetLogReader = () { fakeLogReader.addLine('Foo'); fakeLogReader.addLine('The Dart VM service is listening on http://127.0.0.1:$devicePort'); @@ -637,10 +637,10 @@ void main() { fileSystem: testFileSystem, ); await expectLater( - createTestCommandRunner(command).run(['attach', '--vm-service-port', '100']), + createTestCommandRunner(command).run(['attach', '--observatory-port', '100']), throwsToolExit( message: 'When the --debug-port or --debug-url is unknown, this command does not use ' - 'the value of --vm-service-port.', + 'the value of --observatory-port.', ), ); }, overrides: { @@ -735,7 +735,7 @@ void main() { DeviceManager: () => testDeviceManager, }); - testUsingContext('skips in ipv4 mode with a provided VM Service port', () async { + testUsingContext('skips in ipv4 mode with a provided observatory port', () async { testDeviceManager.devices = [device]; final Completer completer = Completer(); @@ -760,7 +760,7 @@ void main() { 'attach', '--debug-port', '$devicePort', - '--vm-service-port', + '--observatory-port', '$hostPort', // Ensure DDS doesn't use hostPort by binding to a random port. '--dds-port', @@ -780,7 +780,7 @@ void main() { DeviceManager: () => testDeviceManager, }); - testUsingContext('skips in ipv6 mode with a provided VM Service port', () async { + testUsingContext('skips in ipv6 mode with a provided observatory port', () async { testDeviceManager.devices = [device]; final Completer completer = Completer(); @@ -805,7 +805,7 @@ void main() { 'attach', '--debug-port', '$devicePort', - '--vm-service-port', + '--observatory-port', '$hostPort', '--ipv6', // Ensure DDS doesn't use hostPort by binding to a random port. @@ -992,7 +992,7 @@ class FakeHotRunner extends Fake implements HotRunner { bool exited = false; @override - bool isWaitingForVmService = true; + bool isWaitingForObservatory = true; @override Future attach({ @@ -1198,7 +1198,7 @@ class FakeDartDevelopmentService extends Fake implements DartDevelopmentService @override Future startDartDevelopmentService( - Uri vmServiceUri, { + Uri observatoryUri, { required Logger logger, int? hostPort, bool? ipv6, diff --git a/packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart index a50433eb60e57..18f76e86528d4 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/daemon_test.dart @@ -430,8 +430,8 @@ void main() { final String? applicationPackageId = applicationPackageIdResponse.data['result'] as String?; // Try starting the app. - final Uri vmServiceUri = Uri.parse('http://127.0.0.1:12345/vmService'); - device.launchResult = LaunchResult.succeeded(vmServiceUri: vmServiceUri); + final Uri observatoryUri = Uri.parse('http://127.0.0.1:12345/observatory'); + device.launchResult = LaunchResult.succeeded(observatoryUri: observatoryUri); daemonStreams.inputs.add(DaemonMessage({ 'id': 1, 'method': 'device.startApp', @@ -446,7 +446,7 @@ void main() { expect(device.startAppPackage, applicationPackage); final Map startAppResult = startAppResponse.data['result']! as Map; expect(startAppResult['started'], true); - expect(startAppResult['vmServiceUri'], vmServiceUri.toString()); + expect(startAppResult['observatoryUri'], observatoryUri.toString()); // Try stopping the app. daemonStreams.inputs.add(DaemonMessage({ diff --git a/packages/flutter_tools/test/commands.shard/hermetic/proxied_devices_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/proxied_devices_test.dart index fed7e602145ec..a77e516a45ec9 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/proxied_devices_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/proxied_devices_test.dart @@ -161,8 +161,8 @@ void main() { final FakeApplicationPackage applicationPackage = FakeApplicationPackage(); applicationPackageFactory.applicationPackage = applicationPackage; - final Uri vmServiceUri = Uri.parse('http://127.0.0.1:12345/vmService'); - fakeDevice.launchResult = LaunchResult.succeeded(vmServiceUri: vmServiceUri); + final Uri observatoryUri = Uri.parse('http://127.0.0.1:12345/observatory'); + fakeDevice.launchResult = LaunchResult.succeeded(observatoryUri: observatoryUri); final LaunchResult launchResult = await device.startApp( prebuiltApplicationPackage, @@ -170,8 +170,8 @@ void main() { ); expect(launchResult.started, true); - // The returned vmServiceUri was a forwarded port, so we cannot compare them directly. - expect(launchResult.vmServiceUri!.path, vmServiceUri.path); + // The returned observatoryUri was a forwarded port, so we cannot compare them directly. + expect(launchResult.observatoryUri!.path, observatoryUri.path); expect(applicationPackageFactory.applicationBinaryRequested!.readAsStringSync(), 'dummy content'); expect(applicationPackageFactory.platformRequested, TargetPlatform.android_arm); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/screenshot_command_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/screenshot_command_test.dart index 42954dc440a40..f3a4d2560d92a 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/screenshot_command_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/screenshot_command_test.dart @@ -28,26 +28,26 @@ void main() { }; await expectLater(() => createTestCommandRunner(ScreenshotCommand(fs: MemoryFileSystem.test())) - .run(['screenshot', '--type=skia', '--vm-service-url=http://localhost:8181']), + .run(['screenshot', '--type=skia', '--observatory-url=http://localhost:8181']), throwsA(isException.having((Exception exception) => exception.toString(), 'message', contains('dummy'))), ); await expectLater(() => createTestCommandRunner(ScreenshotCommand(fs: MemoryFileSystem.test())) - .run(['screenshot', '--type=rasterizer', '--vm-service-url=http://localhost:8181']), + .run(['screenshot', '--type=rasterizer', '--observatory-url=http://localhost:8181']), throwsA(isException.having((Exception exception) => exception.toString(), 'message', contains('dummy'))), ); }); - testUsingContext('rasterizer and skia screenshots require VM Service uri', () async { + testUsingContext('rasterizer and skia screenshots require observatory uri', () async { await expectLater(() => createTestCommandRunner(ScreenshotCommand(fs: MemoryFileSystem.test())) .run(['screenshot', '--type=skia']), - throwsToolExit(message: 'VM Service URI must be specified for screenshot type skia') + throwsToolExit(message: 'Observatory URI must be specified for screenshot type skia') ); await expectLater(() => createTestCommandRunner(ScreenshotCommand(fs: MemoryFileSystem.test())) .run(['screenshot', '--type=rasterizer',]), - throwsToolExit(message: 'VM Service URI must be specified for screenshot type rasterizer'), + throwsToolExit(message: 'Observatory URI must be specified for screenshot type rasterizer'), ); }); @@ -58,10 +58,10 @@ void main() { ); }); - testUsingContext('device screenshots cannot provided VM Service', () async { + testUsingContext('device screenshots cannot provided Observatory', () async { await expectLater(() => createTestCommandRunner(ScreenshotCommand(fs: MemoryFileSystem.test())) - .run(['screenshot', '--vm-service-url=http://localhost:8181']), - throwsToolExit(message: 'VM Service URI cannot be provided for screenshot type device'), + .run(['screenshot', '--observatory-url=http://localhost:8181']), + throwsToolExit(message: 'Observatory URI cannot be provided for screenshot type device'), ); }); }); diff --git a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart index 4fc3daaa9f9d6..4eba15ec00212 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart @@ -296,7 +296,7 @@ dev_dependencies: Cache: () => Cache.test(processManager: FakeProcessManager.any()), }); - testUsingContext('Pipes enable-vmService', () async { + testUsingContext('Pipes enable-observatory', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0); final TestCommand testCommand = TestCommand(testRunner: testRunner); @@ -311,7 +311,7 @@ dev_dependencies: 'test/fake_test.dart', ]); expect( - testRunner.lastEnableVmServiceValue, + testRunner.lastEnableObservatoryValue, true, ); @@ -324,7 +324,7 @@ dev_dependencies: 'test/fake_test.dart', ]); expect( - testRunner.lastEnableVmServiceValue, + testRunner.lastEnableObservatoryValue, true, ); @@ -335,7 +335,7 @@ dev_dependencies: 'test/fake_test.dart', ]); expect( - testRunner.lastEnableVmServiceValue, + testRunner.lastEnableObservatoryValue, false, ); }, overrides: { @@ -811,7 +811,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner { int exitCode; Duration? leastRunTime; - bool? lastEnableVmServiceValue; + bool? lastEnableObservatoryValue; late DebuggingOptions lastDebuggingOptionsValue; String? lastReporterOption; @@ -824,7 +824,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner { List plainNames = const [], String? tags, String? excludeTags, - bool enableVmService = false, + bool enableObservatory = false, bool ipv6 = false, bool machine = false, String? precompiledDillPath, @@ -847,7 +847,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner { String? integrationTestUserIdentifier, TestTimeRecorder? testTimeRecorder, }) async { - lastEnableVmServiceValue = enableVmService; + lastEnableObservatoryValue = enableObservatory; lastDebuggingOptionsValue = debuggingOptions; lastReporterOption = reporter; diff --git a/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart b/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart index ac67828cbb279..1ed77e1ba3d96 100644 --- a/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart +++ b/packages/flutter_tools/test/general.shard/android/android_device_start_test.dart @@ -285,7 +285,7 @@ void main() { userIdentifier: '10', ); - // This fails to start due to VM Service discovery issues. + // This fails to start due to observatory discovery issues. expect(launchResult.started, false); expect(processManager, hasNoRemainingExpectations); }); diff --git a/packages/flutter_tools/test/general.shard/cold_test.dart b/packages/flutter_tools/test/general.shard/cold_test.dart index 868816686a99d..84f3c4f52b3ab 100644 --- a/packages/flutter_tools/test/general.shard/cold_test.dart +++ b/packages/flutter_tools/test/general.shard/cold_test.dart @@ -141,7 +141,7 @@ class FakeFlutterDevice extends Fake implements FlutterDevice { FakeFlutterDevice(this.device); @override - Stream get vmServiceUris => const Stream.empty(); + Stream get observatoryUris => const Stream.empty(); @override final Device device; diff --git a/packages/flutter_tools/test/general.shard/coverage_collector_test.dart b/packages/flutter_tools/test/general.shard/coverage_collector_test.dart index be5792e5b85f1..aa41240f6ccf0 100644 --- a/packages/flutter_tools/test/general.shard/coverage_collector_test.dart +++ b/packages/flutter_tools/test/general.shard/coverage_collector_test.dart @@ -647,7 +647,7 @@ class TestTestDevice extends TestDevice { Future kill() => Future.value(); @override - Future get vmServiceUri => Future.value(Uri()); + Future get observatoryUri => Future.value(Uri()); @override Future> start(String entrypointPath) { diff --git a/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart b/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart index 7a56f6c5aaa34..56e70f2afcc7c 100644 --- a/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart +++ b/packages/flutter_tools/test/general.shard/custom_devices/custom_device_test.dart @@ -359,7 +359,7 @@ void main() { expect(forwardPortCommandCompleter.isCompleted, true); }); - testWithoutContext('CustomDevice forwards VM Service port correctly when port forwarding is configured', () async { + testWithoutContext('CustomDevice forwards observatory port correctly when port forwarding is configured', () async { final Completer runDebugCompleter = Completer(); final Completer forwardPortCompleter = Completer(); @@ -391,7 +391,7 @@ void main() { final LaunchResult launchResult = await appSession.start(debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug)); expect(launchResult.started, true); - expect(launchResult.vmServiceUri, Uri.parse('http://127.0.0.1:12345/abcd/')); + expect(launchResult.observatoryUri, Uri.parse('http://127.0.0.1:12345/abcd/')); expect(runDebugCompleter.isCompleted, false); expect(forwardPortCompleter.isCompleted, false); @@ -400,7 +400,7 @@ void main() { expect(forwardPortCompleter.isCompleted, true); }); - testWithoutContext('CustomDeviceAppSession forwards VM Service port correctly when port forwarding is not configured', () async { + testWithoutContext('CustomDeviceAppSession forwards observatory port correctly when port forwarding is not configured', () async { final Completer runDebugCompleter = Completer(); final FakeProcessManager processManager = FakeProcessManager.list( @@ -428,7 +428,7 @@ void main() { final LaunchResult launchResult = await appSession.start(debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug)); expect(launchResult.started, true); - expect(launchResult.vmServiceUri, Uri.parse('http://192.168.178.123:12345/abcd/')); + expect(launchResult.observatoryUri, Uri.parse('http://192.168.178.123:12345/abcd/')); expect(runDebugCompleter.isCompleted, false); expect(await appSession.stop(), true); @@ -501,8 +501,8 @@ void main() { bundleBuilder: FakeBundleBuilder() ); expect(result.started, true); - expect(result.hasVmService, true); - expect(result.vmServiceUri, Uri.tryParse('http://127.0.0.1:12345/abcd/')); + expect(result.hasObservatory, true); + expect(result.observatoryUri, Uri.tryParse('http://127.0.0.1:12345/abcd/')); expect(runDebugCompleter.isCompleted, false); expect(forwardPortCompleter.isCompleted, false); diff --git a/packages/flutter_tools/test/general.shard/desktop_device_test.dart b/packages/flutter_tools/test/general.shard/desktop_device_test.dart index 582e50efd857d..937f0c78f2f84 100644 --- a/packages/flutter_tools/test/general.shard/desktop_device_test.dart +++ b/packages/flutter_tools/test/general.shard/desktop_device_test.dart @@ -96,7 +96,7 @@ void main() { ); expect(result.started, true); - expect(result.vmServiceUri, Uri.parse('http://127.0.0.1/0')); + expect(result.observatoryUri, Uri.parse('http://127.0.0.1/0')); }); testWithoutContext('Null executable path fails gracefully', () async { diff --git a/packages/flutter_tools/test/general.shard/device_test.dart b/packages/flutter_tools/test/general.shard/device_test.dart index 6b4e1bcc7a235..d97a6a24de0bb 100644 --- a/packages/flutter_tools/test/general.shard/device_test.dart +++ b/packages/flutter_tools/test/general.shard/device_test.dart @@ -509,7 +509,7 @@ void main() { [ '--enable-dart-profiling', '--disable-service-auth-codes', - '--disable-vm-service-publication', + '--disable-observatory-publication', '--start-paused', '--dart-flags="--foo,--null_assertions"', '--use-test-fonts', @@ -529,7 +529,7 @@ void main() { '--route=/test', '--trace-startup', '--enable-impeller', - '--vm-service-port=0', + '--observatory-port=0', ].join(' '), ); }); @@ -573,7 +573,7 @@ void main() { '--enable-dart-profiling', '--enable-checked-mode', '--verify-entry-points', - '--vm-service-host=0.0.0.0', + '--observatory-host=0.0.0.0', ].join(' '), ); }); @@ -597,7 +597,7 @@ void main() { '--enable-dart-profiling', '--enable-checked-mode', '--verify-entry-points', - '--vm-service-host=::0', + '--observatory-host=::0', ].join(' '), ); }); @@ -669,7 +669,7 @@ void main() { [ '--enable-dart-profiling', '--disable-service-auth-codes', - '--disable-vm-service-publication', + '--disable-observatory-publication', '--start-paused', '--dart-flags=--foo,--null_assertions', '--use-test-fonts', @@ -689,7 +689,7 @@ void main() { '--route=/test', '--trace-startup', '--enable-impeller', - '--vm-service-port=1', + '--observatory-port=1', ].join(' '), ); }); diff --git a/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart b/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart index dc68e7de0d87c..e40e567c24ea0 100644 --- a/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart +++ b/packages/flutter_tools/test/general.shard/drive/drive_service_test.dart @@ -114,7 +114,7 @@ void main() { ]); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService); final Device device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), ))..failOnce = true; await expectLater( @@ -139,7 +139,7 @@ void main() { ]); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService); final Device device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), )); await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true); @@ -170,7 +170,7 @@ void main() { final FakeDevtoolsLauncher launcher = FakeDevtoolsLauncher(); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService, devtoolsLauncher: launcher); final Device device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), )); await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true); @@ -202,7 +202,7 @@ void main() { ]); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService); final Device device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), )); await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true); @@ -232,7 +232,7 @@ void main() { ]); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService); final Device device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), )); final FakeDartDevelopmentService dds = device.dds as FakeDartDevelopmentService; @@ -258,7 +258,7 @@ void main() { final FakeProcessManager processManager = FakeProcessManager.empty(); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService); final FakeDevice device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), )); await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true); @@ -290,7 +290,7 @@ void main() { final FakeProcessManager processManager = FakeProcessManager.empty(); final DriverService driverService = setUpDriverService(processManager: processManager, vmService: fakeVmServiceHost.vmService); final FakeDevice device = FakeDevice(LaunchResult.succeeded( - vmServiceUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), + observatoryUri: Uri.parse('http://127.0.0.1:63426/1UasC_ihpXY=/'), )); await driverService.start(BuildInfo.profile, device, DebuggingOptions.enabled(BuildInfo.profile), true); @@ -551,7 +551,7 @@ class FakeDartDevelopmentService extends Fake implements DartDevelopmentService @override Future startDartDevelopmentService( - Uri vmServiceUri, { + Uri observatoryUri, { required Logger logger, int? hostPort, bool? ipv6, diff --git a/packages/flutter_tools/test/general.shard/flutter_platform_test.dart b/packages/flutter_tools/test/general.shard/flutter_platform_test.dart index 89510dcd47692..68e457d65b4c7 100644 --- a/packages/flutter_tools/test/general.shard/flutter_platform_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_platform_test.dart @@ -26,14 +26,14 @@ void main() { group('FlutterPlatform', () { testUsingContext('ensureConfiguration throws an error if an ' - 'explicitVmServicePort is specified and more than one test file', () async { + 'explicitObservatoryPort is specified and more than one test file', () async { final FlutterPlatform flutterPlatform = FlutterPlatform( shellPath: '/', debuggingOptions: DebuggingOptions.enabled( BuildInfo.debug, hostVmServicePort: 1234, ), - enableVmService: false, + enableObservatory: false, ); flutterPlatform.loadChannel('test1.dart', FakeSuitePlatform()); @@ -49,7 +49,7 @@ void main() { debuggingOptions: DebuggingOptions.enabled(BuildInfo.debug), shellPath: '/', precompiledDillPath: 'example.dill', - enableVmService: false, + enableObservatory: false, ); flutterPlatform.loadChannel('test1.dart', FakeSuitePlatform()); @@ -87,7 +87,7 @@ void main() { disableServiceAuthCodes: true, hostVmServicePort: 200, ), - enableVmService: true, + enableObservatory: true, machine: true, precompiledDillPath: 'def', precompiledDillFiles: expectedPrecompiledDillFiles, @@ -107,7 +107,7 @@ void main() { expect(flutterPlatform.debuggingOptions.startPaused, equals(true)); expect(flutterPlatform.debuggingOptions.disableServiceAuthCodes, equals(true)); expect(flutterPlatform.debuggingOptions.hostVmServicePort, equals(200)); - expect(flutterPlatform.enableVmService, equals(true)); + expect(flutterPlatform.enableObservatory, equals(true)); expect(flutterPlatform.machine, equals(true)); expect(flutterPlatform.host, InternetAddress.loopbackIPv6); expect(flutterPlatform.precompiledDillPath, equals('def')); diff --git a/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart b/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart index ac29e206ad726..8edeafafb17f8 100644 --- a/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart +++ b/packages/flutter_tools/test/general.shard/flutter_tester_device_test.dart @@ -38,13 +38,13 @@ void main() { FlutterTesterTestDevice createDevice({ List dartEntrypointArgs = const [], - bool enableVmService = false, + bool enableObservatory = false, }) => TestFlutterTesterDevice( platform: platform, fileSystem: fileSystem, processManager: processManager, - enableVmService: enableVmService, + enableObservatory: enableObservatory, dartEntrypointArgs: dartEntrypointArgs, uriConverter: (String input) => '$input/converted', ); @@ -63,7 +63,7 @@ void main() { FakeCommand flutterTestCommand(String expectedFlutterTestValue) { return FakeCommand(command: const [ '/', - '--disable-vm-service', + '--disable-observatory', '--ipv6', '--enable-checked-mode', '--verify-entry-points', @@ -121,7 +121,7 @@ void main() { const FakeCommand( command: [ '/', - '--disable-vm-service', + '--disable-observatory', '--ipv6', '--enable-checked-mode', '--verify-entry-points', @@ -156,7 +156,7 @@ void main() { const FakeCommand( command: [ '/', - '--vm-service-port=0', + '--observatory-port=0', '--ipv6', '--enable-checked-mode', '--verify-entry-points', @@ -173,12 +173,12 @@ void main() { stderr: 'failure', ), ]); - device = createDevice(enableVmService: true); + device = createDevice(enableObservatory: true); }); - testUsingContext('skips setting VM Service port and uses the input port for DDS instead', () async { + testUsingContext('skips setting observatory port and uses the input port for DDS instead', () async { await device.start('example.dill'); - await device.vmServiceUri; + await device.observatoryUri; final Uri uri = await (device as TestFlutterTesterDevice).ddsServiceUriFuture(); expect(uri.port, 1234); @@ -186,7 +186,7 @@ void main() { testUsingContext('sets up UriConverter from context', () async { await device.start('example.dill'); - await device.vmServiceUri; + await device.observatoryUri; final FakeDartDevelopmentService dds = (device as TestFlutterTesterDevice).dds as FakeDartDevelopmentService; @@ -206,7 +206,7 @@ class TestFlutterTesterDevice extends FlutterTesterTestDevice { required super.platform, required super.fileSystem, required super.processManager, - required super.enableVmService, + required super.enableObservatory, required List dartEntrypointArgs, required UriConverter uriConverter, }) : super( diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart index eb1cb5780c832..f7e23f78ba501 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_start_test.dart @@ -152,7 +152,7 @@ void main() { final LaunchResult launchResult = await setupAndStartApp(prebuilt: true, mode: BuildMode.release); expect(launchResult.started, isFalse); - expect(launchResult.hasVmService, isFalse); + expect(launchResult.hasObservatory, isFalse); }, overrides: { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, @@ -167,7 +167,7 @@ void main() { final LaunchResult launchResult = await setupAndStartApp(prebuilt: true, mode: BuildMode.release); expect(launchResult.started, isTrue); - expect(launchResult.hasVmService, isFalse); + expect(launchResult.hasObservatory, isFalse); }, overrides: { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, @@ -194,7 +194,7 @@ void main() { final LaunchResult launchResult = await device.startApp(app, prebuiltApplication: true, debuggingOptions: debuggingOptions); expect(launchResult.started, isFalse); - expect(launchResult.hasVmService, isFalse); + expect(launchResult.hasObservatory, isFalse); }, overrides: { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, @@ -220,7 +220,7 @@ void main() { final LaunchResult launchResult = await device.startApp(app, prebuiltApplication: true, debuggingOptions: debuggingOptions); expect(launchResult.started, isTrue); - expect(launchResult.hasVmService, isFalse); + expect(launchResult.hasObservatory, isFalse); expect(await device.stopApp(app), isTrue); }, overrides: { Artifacts: () => artifacts, @@ -252,7 +252,7 @@ void main() { final LaunchResult launchResult = await setupAndStartApp(prebuilt: true, mode: BuildMode.debug); expect(launchResult.started, isTrue); - expect(launchResult.hasVmService, isTrue); + expect(launchResult.hasObservatory, isTrue); }, overrides: { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, @@ -413,7 +413,7 @@ void main() { final LaunchResult launchResult = await setupAndStartApp(prebuilt: true, mode: BuildMode.release); expect(launchResult.started, isFalse); - expect(launchResult.hasVmService, isFalse); + expect(launchResult.hasObservatory, isFalse); }, overrides: { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, @@ -429,7 +429,7 @@ void main() { final LaunchResult launchResult = await setupAndStartApp(prebuilt: true, mode: BuildMode.release); expect(launchResult.started, isFalse); - expect(launchResult.hasVmService, isFalse); + expect(launchResult.hasObservatory, isFalse); }, overrides: { Artifacts: () => artifacts, FileSystem: () => memoryFileSystem, diff --git a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart index 641d4e0ef1bc3..d3d51147efdd0 100644 --- a/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart +++ b/packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart @@ -1035,7 +1035,7 @@ class FakeDartDevelopmentService extends Fake implements DartDevelopmentService { @override Future startDartDevelopmentService( - Uri vmServiceUri, { + Uri observatoryUri, { required Logger logger, int? hostPort, bool? ipv6, diff --git a/packages/flutter_tools/test/general.shard/integration_test_device_test.dart b/packages/flutter_tools/test/general.shard/integration_test_device_test.dart index 804275eb8409e..6d2a90c1a36e5 100644 --- a/packages/flutter_tools/test/general.shard/integration_test_device_test.dart +++ b/packages/flutter_tools/test/general.shard/integration_test_device_test.dart @@ -58,7 +58,7 @@ final FakeVmServiceRequest listViewsRequest = FakeVmServiceRequest( }, ); -final Uri vmServiceUri = Uri.parse('http://localhost:1234'); +final Uri observatoryUri = Uri.parse('http://localhost:1234'); void main() { late FakeVmServiceHost fakeVmServiceHost; @@ -71,7 +71,7 @@ void main() { 'ephemeral', 'ephemeral', type: PlatformType.android, - launchResult: LaunchResult.succeeded(vmServiceUri: vmServiceUri), + launchResult: LaunchResult.succeeded(observatoryUri: observatoryUri), ), debuggingOptions: DebuggingOptions.enabled( BuildInfo.debug, @@ -126,7 +126,7 @@ void main() { testUsingContext('Can start the entrypoint', () async { await testDevice.start('entrypointPath'); - expect(await testDevice.vmServiceUri, vmServiceUri); + expect(await testDevice.observatoryUri, observatoryUri); expect(testDevice.finished, doesNotComplete); }, overrides: { ApplicationPackageFactory: () => FakeApplicationPackageFactory(), @@ -161,7 +161,7 @@ void main() { }) async => fakeVmServiceHost.vmService, }); - testUsingContext('when the device starts without providing an vmService URI', () async { + testUsingContext('when the device starts without providing an observatory URI', () async { final TestDevice testDevice = IntegrationTestTestDevice( id: 1, device: FakeDevice( diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart index 916c3e2d0aebc..e26ef2b153fbe 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart @@ -85,7 +85,7 @@ FakeCommand attachDebuggerCommand({ if (!isNetworkDevice) '--no-wifi', '--args', if (isNetworkDevice) - '--enable-dart-profiling --enable-checked-mode --verify-entry-points --vm-service-host=0.0.0.0' + '--enable-dart-profiling --enable-checked-mode --verify-entry-points --observatory-host=0.0.0.0' else '--enable-dart-profiling --enable-checked-mode --verify-entry-points', ], @@ -152,7 +152,7 @@ void main() { ); expect(launchResult.started, true); - expect(launchResult.hasVmService, true); + expect(launchResult.hasObservatory, true); expect(await device.stopApp(iosApp), false); }); @@ -190,7 +190,7 @@ void main() { ); expect(launchResult.started, true); - expect(launchResult.hasVmService, true); + expect(launchResult.hasObservatory, true); expect(await device.stopApp(iosApp), false); }); @@ -230,7 +230,7 @@ void main() { ); expect(launchResult.started, true); - expect(launchResult.hasVmService, true); + expect(launchResult.hasObservatory, true); expect(await device.stopApp(iosApp), false); expect(logger.errorText, contains('The Dart VM Service was not discovered after 30 seconds. This is taking much longer than expected...')); expect(utf8.decoder.convert(stdin.writes.first), contains('process interrupt')); @@ -275,7 +275,7 @@ void main() { ); expect(launchResult.started, true); - expect(launchResult.hasVmService, true); + expect(launchResult.hasObservatory, true); expect(await device.stopApp(iosApp), false); expect(logger.errorText, contains('The Dart VM Service was not discovered after 45 seconds. This is taking much longer than expected...')); expect(logger.errorText, contains('Click "Allow" to the prompt asking if you would like to find and connect devices on your local network.')); @@ -308,7 +308,7 @@ void main() { ); expect(launchResult.started, true); - expect(launchResult.hasVmService, false); + expect(launchResult.hasObservatory, false); expect(await device.stopApp(iosApp), false); expect(processManager, hasNoRemainingExpectations); }); @@ -335,7 +335,7 @@ void main() { [ '--enable-dart-profiling', '--disable-service-auth-codes', - '--disable-vm-service-publication', + '--disable-observatory-publication', '--start-paused', '--dart-flags="--foo,--null_assertions"', '--use-test-fonts', diff --git a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart index 3bd597e36a351..367b7848eb980 100644 --- a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart @@ -1067,7 +1067,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' '--purge-persistent-cache', '--dart-flags=--baz,--null_assertions', '--enable-impeller', - '--vm-service-port=0', + '--observatory-port=0', ])); }, overrides: { PlistParser: () => testPlistParser, diff --git a/packages/flutter_tools/test/general.shard/preview_device_test.dart b/packages/flutter_tools/test/general.shard/preview_device_test.dart index fa94d8600f366..f1f44267856ff 100644 --- a/packages/flutter_tools/test/general.shard/preview_device_test.dart +++ b/packages/flutter_tools/test/general.shard/preview_device_test.dart @@ -78,7 +78,7 @@ void main() { ); expect(result.started, true); - expect(result.vmServiceUri, Uri.parse('http://127.0.0.1:64494/fZ_B2N6JRwY=/')); + expect(result.observatoryUri, Uri.parse('http://127.0.0.1:64494/fZ_B2N6JRwY=/')); }); } diff --git a/packages/flutter_tools/test/general.shard/protocol_discovery_test.dart b/packages/flutter_tools/test/general.shard/protocol_discovery_test.dart index 0bd89a3a033bb..cea1746a809e8 100644 --- a/packages/flutter_tools/test/general.shard/protocol_discovery_test.dart +++ b/packages/flutter_tools/test/general.shard/protocol_discovery_test.dart @@ -17,7 +17,7 @@ void main() { setUp(() { logReader = FakeDeviceLogReader(); - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, throttleDuration: const Duration(milliseconds: 5), @@ -106,7 +106,7 @@ void main() { testWithoutContext('uri waits for correct log line', () async { final Future uriFuture = discoverer.uri; - logReader.addLine('VM Service not listening...'); + logReader.addLine('Observatory not listening...'); final Uri timeoutUri = Uri.parse('http://timeout'); final Uri? actualUri = await uriFuture.timeout( const Duration(milliseconds: 100), @@ -139,7 +139,7 @@ void main() { }); testWithoutContext('skips uri if port does not match the requested vmservice - requested last', () async { - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, devicePort: 12346, @@ -155,7 +155,7 @@ void main() { }); testWithoutContext('skips uri if port does not match the requested vmservice - requested first', () async { - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, devicePort: 12346, @@ -179,7 +179,7 @@ void main() { }); testWithoutContext('first uri in the stream is the last one from the log that matches the port', () async { - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, devicePort: 12345, @@ -195,7 +195,7 @@ void main() { }); testWithoutContext('protocol discovery does not crash if the log reader is closed while delaying', () async { - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, devicePort: 12346, @@ -216,7 +216,7 @@ void main() { const Duration kThrottleDuration = Duration(milliseconds: 10); FakeAsync().run((FakeAsync time) { - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, throttleDuration: kThrottleDuration, @@ -250,7 +250,7 @@ void main() { const Duration kThrottleTimeInMilliseconds = Duration(milliseconds: 10); FakeAsync().run((FakeAsync time) { - discoverer = ProtocolDiscovery.vmService( + discoverer = ProtocolDiscovery.observatory( logReader, ipv6: false, devicePort: 12345, @@ -285,7 +285,7 @@ void main() { group('port forwarding', () { testWithoutContext('default port', () async { final FakeDeviceLogReader logReader = FakeDeviceLogReader(); - final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService( + final ProtocolDiscovery discoverer = ProtocolDiscovery.observatory( logReader, portForwarder: MockPortForwarder(99), ipv6: false, @@ -305,7 +305,7 @@ void main() { testWithoutContext('specified port', () async { final FakeDeviceLogReader logReader = FakeDeviceLogReader(); - final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService( + final ProtocolDiscovery discoverer = ProtocolDiscovery.observatory( logReader, portForwarder: MockPortForwarder(99), hostPort: 1243, @@ -326,7 +326,7 @@ void main() { testWithoutContext('specified port zero', () async { final FakeDeviceLogReader logReader = FakeDeviceLogReader(); - final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService( + final ProtocolDiscovery discoverer = ProtocolDiscovery.observatory( logReader, portForwarder: MockPortForwarder(99), hostPort: 0, @@ -347,7 +347,7 @@ void main() { testWithoutContext('ipv6', () async { final FakeDeviceLogReader logReader = FakeDeviceLogReader(); - final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService( + final ProtocolDiscovery discoverer = ProtocolDiscovery.observatory( logReader, portForwarder: MockPortForwarder(99), hostPort: 54777, @@ -368,7 +368,7 @@ void main() { testWithoutContext('ipv6 with Ascii Escape code', () async { final FakeDeviceLogReader logReader = FakeDeviceLogReader(); - final ProtocolDiscovery discoverer = ProtocolDiscovery.vmService( + final ProtocolDiscovery discoverer = ProtocolDiscovery.observatory( logReader, portForwarder: MockPortForwarder(99), hostPort: 54777, diff --git a/packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart b/packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart index 8c36d4e828b50..171030cec1551 100644 --- a/packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_devtools_handler_test.dart @@ -421,7 +421,7 @@ void main() { expect(handler.launchedInBrowser, isTrue); }); - testWithoutContext('Converts a VM Service URI with a query parameter to a pretty display string', () { + testWithoutContext('Converts a VmService URI with a query parameter to a pretty display string', () { const String value = 'http://127.0.0.1:9100?uri=http%3A%2F%2F127.0.0.1%3A57922%2F_MXpzytpH20%3D%2F'; final Uri uri = Uri.parse(value); diff --git a/packages/flutter_tools/test/general.shard/resident_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_runner_test.dart index c0e101284b2db..f9c9f61eb4485 100644 --- a/packages/flutter_tools/test/general.shard/resident_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_runner_test.dart @@ -1492,7 +1492,7 @@ flutter: commandHelp.c, commandHelp.q, '', - 'A Dart VM Service on FakeDevice is available at: null', + 'An Observatory debugger and profiler on FakeDevice is available at: null', '', ].join('\n') )); @@ -1521,7 +1521,7 @@ flutter: commandHelp.c, commandHelp.q, '', - 'A Dart VM Service on FakeDevice is available at: null', + 'An Observatory debugger and profiler on FakeDevice is available at: null', '', ].join('\n') )); @@ -2123,7 +2123,7 @@ flutter: }; final TestFlutterDevice flutterDevice = TestFlutterDevice( device, - vmServiceUris: Stream.value(testUri), + observatoryUris: Stream.value(testUri), ); bool caught = false; final Completerdone = Completer(); @@ -2166,7 +2166,7 @@ flutter: }; final TestFlutterDevice flutterDevice = TestFlutterDevice( device, - vmServiceUris: Stream.value(testUri), + observatoryUris: Stream.value(testUri), ); final Completer done = Completer(); await runZonedGuarded( @@ -2199,7 +2199,7 @@ flutter: }; final TestFlutterDevice flutterDevice = TestFlutterDevice( device, - vmServiceUris: Stream.value(testUri), + observatoryUris: Stream.value(testUri), ); final Completerdone = Completer(); await runZonedGuarded( @@ -2238,7 +2238,7 @@ flutter: }; final TestFlutterDevice flutterDevice = TestFlutterDevice( device, - vmServiceUris: Stream.value(testUri), + observatoryUris: Stream.value(testUri), ); await flutterDevice.connect(allowExistingDdsInstance: true, ipv6: true, disableServiceAuthCodes: true); await done.future; @@ -2279,7 +2279,7 @@ flutter: }; final TestFlutterDevice flutterDevice = TestFlutterDevice( device, - vmServiceUris: Stream.value(testUri), + observatoryUris: Stream.value(testUri), ); await flutterDevice.connect(allowExistingDdsInstance: true, ipv6: true, disableServiceAuthCodes: true); await done.future; @@ -2319,7 +2319,7 @@ flutter: }; final TestFlutterDevice flutterDevice = TestFlutterDevice( device, - vmServiceUris: Stream.value(testUri), + observatoryUris: Stream.value(testUri), ); bool caught = false; final Completerdone = Completer(); @@ -2487,13 +2487,13 @@ class FakeDartDevelopmentServiceException implements dds.DartDevelopmentServiceE } class TestFlutterDevice extends FlutterDevice { - TestFlutterDevice(super.device, { Stream? vmServiceUris }) - : _vmServiceUris = vmServiceUris, super(buildInfo: BuildInfo.debug, developmentShaderCompiler: const FakeShaderCompiler()); + TestFlutterDevice(super.device, { Stream? observatoryUris }) + : _observatoryUris = observatoryUris, super(buildInfo: BuildInfo.debug, developmentShaderCompiler: const FakeShaderCompiler()); - final Stream? _vmServiceUris; + final Stream? _observatoryUris; @override - Stream get vmServiceUris => _vmServiceUris!; + Stream get observatoryUris => _observatoryUris!; } class ThrowingForwardingFileSystem extends ForwardingFileSystem { @@ -2530,7 +2530,7 @@ class FakeFlutterDevice extends Fake implements FlutterDevice { TargetPlatform get targetPlatform => TargetPlatform.android; @override - Stream get vmServiceUris => Stream.value(testUri); + Stream get observatoryUris => Stream.value(testUri); @override FlutterVmService? get vmService => vmServiceHost?.call()?.vmService; diff --git a/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart b/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart index d00bbba29b493..4d38c6ef3d895 100644 --- a/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart +++ b/packages/flutter_tools/test/general.shard/resident_web_runner_test.dart @@ -1597,7 +1597,7 @@ class FakeFlutterDevice extends Fake implements FlutterDevice { ResidentCompiler? generator; @override - Stream get vmServiceUris => Stream.value(testUri); + Stream get observatoryUris => Stream.value(testUri); @override DevelopmentShaderCompiler get developmentShaderCompiler => const FakeShaderCompiler(); diff --git a/packages/flutter_tools/test/general.shard/test/event_printer_test.dart b/packages/flutter_tools/test/general.shard/test/event_printer_test.dart index 7cb7d28328454..5d1117f84b938 100644 --- a/packages/flutter_tools/test/general.shard/test/event_printer_test.dart +++ b/packages/flutter_tools/test/general.shard/test/event_printer_test.dart @@ -10,7 +10,7 @@ import '../../src/common.dart'; void main() { group(EventPrinter, () { - final Uri vmServiceUri = Uri.parse('http://localhost:1234'); + final Uri observatoryUri = Uri.parse('http://localhost:1234'); late EventPrinter eventPrinter; late StringBuffer output; @@ -23,30 +23,30 @@ void main() { final FakeDevice device = FakeDevice(); expect(() => eventPrinter.handleFinishedTest(device), returnsNormally); - expect(() => eventPrinter.handleStartedDevice(vmServiceUri), returnsNormally); + expect(() => eventPrinter.handleStartedDevice(observatoryUri), returnsNormally); expect(() => eventPrinter.handleTestCrashed(device), returnsNormally); expect(() => eventPrinter.handleTestTimedOut(device), returnsNormally); }); group('handleStartedDevice', () { - testWithoutContext('with non-null VM Service', () { - eventPrinter.handleStartedDevice(vmServiceUri); + testWithoutContext('with non-null observatory', () { + eventPrinter.handleStartedDevice(observatoryUri); expect( output.toString(), '\n' - '[{"event":"test.startedProcess","params":{"vmServiceUri":"http://localhost:1234"}}]' + '[{"event":"test.startedProcess","params":{"observatoryUri":"http://localhost:1234"}}]' '\n', ); }); - testWithoutContext('with null VM Service', () { + testWithoutContext('with null observatory', () { eventPrinter.handleStartedDevice(null); expect( output.toString(), '\n' - '[{"event":"test.startedProcess","params":{"vmServiceUri":null}}]' + '[{"event":"test.startedProcess","params":{"observatoryUri":null}}]' '\n', ); }); diff --git a/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart b/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart index c284f76ef8ad3..27751bbf204c7 100644 --- a/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart +++ b/packages/flutter_tools/test/general.shard/tester/flutter_tester_test.dart @@ -140,7 +140,7 @@ void main() { testUsingContext('performs a build and starts in debug mode', () async { final FlutterTesterApp app = FlutterTesterApp.fromCurrentDirectory(fileSystem); - final Uri vmServiceUri = Uri.parse('http://127.0.0.1:6666/'); + final Uri observatoryUri = Uri.parse('http://127.0.0.1:6666/'); final Completer completer = Completer(); fakeProcessManager.addCommand(FakeCommand( command: const [ @@ -155,7 +155,7 @@ void main() { completer: completer, stdout: ''' -The Dart VM service is listening on $vmServiceUri +The Dart VM service is listening on $observatoryUri Hello! ''', )); @@ -166,14 +166,14 @@ Hello! ); expect(result.started, isTrue); - expect(result.vmServiceUri, vmServiceUri); + expect(result.observatoryUri, observatoryUri); expect(logLines.last, 'Hello!'); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: startOverrides); testUsingContext('performs a build and starts in debug mode with track-widget-creation', () async { final FlutterTesterApp app = FlutterTesterApp.fromCurrentDirectory(fileSystem); - final Uri vmServiceUri = Uri.parse('http://127.0.0.1:6666/'); + final Uri observatoryUri = Uri.parse('http://127.0.0.1:6666/'); final Completer completer = Completer(); fakeProcessManager.addCommand(FakeCommand( command: const [ @@ -188,7 +188,7 @@ Hello! completer: completer, stdout: ''' -The Dart VM service is listening on $vmServiceUri +The Dart VM service is listening on $observatoryUri Hello! ''', )); @@ -199,7 +199,7 @@ Hello! ); expect(result.started, isTrue); - expect(result.vmServiceUri, vmServiceUri); + expect(result.observatoryUri, observatoryUri); expect(logLines.last, 'Hello!'); expect(fakeProcessManager, hasNoRemainingExpectations); }, overrides: startOverrides); diff --git a/packages/flutter_tools/test/general.shard/vmservice_test.dart b/packages/flutter_tools/test/general.shard/vmservice_test.dart index c5238a37adf63..837706b9c3781 100644 --- a/packages/flutter_tools/test/general.shard/vmservice_test.dart +++ b/packages/flutter_tools/test/general.shard/vmservice_test.dart @@ -59,7 +59,7 @@ final FakeVmServiceRequest listViewsRequest = FakeVmServiceRequest( ); void main() { - testWithoutContext('VM Service registers reloadSources', () async { + testWithoutContext('VmService registers reloadSources', () async { Future reloadSources(String isolateId, { bool? pause, bool? force}) async {} final MockVMService mockVMService = MockVMService(); @@ -76,7 +76,7 @@ void main() { expect(mockVMService.services, containsPair('reloadSources', 'Flutter Tools')); }); - testWithoutContext('VM Service registers flutterMemoryInfo service', () async { + testWithoutContext('VmService registers flutterMemoryInfo service', () async { final FakeDevice mockDevice = FakeDevice(); final MockVMService mockVMService = MockVMService(); @@ -93,7 +93,7 @@ void main() { expect(mockVMService.services, containsPair('flutterMemoryInfo', 'Flutter Tools')); }); - testWithoutContext('VM Service registers flutterGetSkSL service', () async { + testWithoutContext('VmService registers flutterGetSkSL service', () async { final MockVMService mockVMService = MockVMService(); await setUpVmService( null, @@ -108,7 +108,7 @@ void main() { expect(mockVMService.services, containsPair('flutterGetSkSL', 'Flutter Tools')); }); - testWithoutContext('VM Service throws tool exit on service registration failure.', () async { + testWithoutContext('VmService throws tool exit on service registration failure.', () async { final MockVMService mockVMService = MockVMService() ..errorOnRegisterService = true; @@ -123,7 +123,7 @@ void main() { ), throwsToolExit()); }); - testWithoutContext('VM Service throws tool exit on service registration failure with awaited future.', () async { + testWithoutContext('VmService throws tool exit on service registration failure with awaited future.', () async { final MockVMService mockVMService = MockVMService() ..errorOnRegisterService = true; @@ -138,7 +138,7 @@ void main() { ), throwsToolExit()); }); - testWithoutContext('VM Service registers flutterPrintStructuredErrorLogMethod', () async { + testWithoutContext('VmService registers flutterPrintStructuredErrorLogMethod', () async { final MockVMService mockVMService = MockVMService(); await setUpVmService( null, @@ -152,7 +152,7 @@ void main() { expect(mockVMService.listenedStreams, contains(vm_service.EventStreams.kExtension)); }); - testWithoutContext('VM Service returns correct FlutterVersion', () async { + testWithoutContext('VMService returns correct FlutterVersion', () async { final MockVMService mockVMService = MockVMService(); await setUpVmService( null, @@ -167,7 +167,7 @@ void main() { expect(mockVMService.services, containsPair('flutterVersion', 'Flutter Tools')); }); - testUsingContext('VM Service prints messages for connection failures', () { + testUsingContext('VMService prints messages for connection failures', () { final BufferLogger logger = BufferLogger.test(); FakeAsync().run((FakeAsync time) { final Uri uri = Uri.parse('ws://127.0.0.1:12345/QqL7EFEDNG0=/ws'); diff --git a/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart b/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart index 7f3570e53f49b..32ad2c2daab7d 100644 --- a/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart +++ b/packages/flutter_tools/test/general.shard/web/golden_comparator_test.dart @@ -40,7 +40,7 @@ void main() { processManager.addCommand(FakeCommand( command: const [ 'shell', - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output', @@ -74,7 +74,7 @@ void main() { processManager.addCommand(FakeCommand( command: const [ 'shell', - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output', @@ -107,7 +107,7 @@ void main() { processManager.addCommand(FakeCommand( command: const [ 'shell', - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output', @@ -143,7 +143,7 @@ void main() { processManager.addCommand(FakeCommand( command: const [ 'shell', - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output', @@ -152,7 +152,7 @@ void main() { processManager.addCommand(FakeCommand( command: const [ 'shell', - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output', @@ -186,7 +186,7 @@ void main() { processManager.addCommand(FakeCommand( command: const [ 'shell', - '--disable-vm-service', + '--disable-observatory', '--non-interactive', '--packages=.dart_tool/package_config.json', 'compiler_output', diff --git a/packages/flutter_tools/test/general.shard/xcode_backend_test.dart b/packages/flutter_tools/test/general.shard/xcode_backend_test.dart index fe7bb292343ff..626db261daabd 100644 --- a/packages/flutter_tools/test/general.shard/xcode_backend_test.dart +++ b/packages/flutter_tools/test/general.shard/xcode_backend_test.dart @@ -195,12 +195,12 @@ void main() { }); }); - group('test_vm_service_bonjour_service', () { + group('test_observatory_bonjour_service', () { test('handles when the Info.plist is missing', () { final Directory buildDir = fileSystem.directory('/path/to/builds'); buildDir.createSync(recursive: true); final TestContext context = TestContext( - ['test_vm_service_bonjour_service'], + ['test_observatory_bonjour_service'], { 'CONFIGURATION': 'Debug', 'BUILT_PRODUCTS_DIR': buildDir.path, @@ -212,7 +212,7 @@ void main() { expect( context.stdout, contains( - 'Info.plist does not exist. Skipping _dartVmService._tcp NSBonjourServices insertion.'), + 'Info.plist does not exist. Skipping _dartobservatory._tcp NSBonjourServices insertion.'), ); }); }); diff --git a/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart b/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart index fd2a7f723bf03..6b0081f72a032 100644 --- a/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart +++ b/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart @@ -157,7 +157,7 @@ void main() { expect(_containsBitcode(outputFlutterFrameworkBinary.path, processManager), isFalse); }); - testWithoutContext('Info.plist dart VM Service Bonjour service', () { + testWithoutContext('Info.plist dart observatory Bonjour service', () { final String infoPlistPath = fileSystem.path.join( outputApp.path, 'Info.plist', @@ -173,7 +173,7 @@ void main() { infoPlistPath, ], ); - final bool bonjourServicesFound = (bonjourServices.stdout as String).contains('_dartVmService._tcp'); + final bool bonjourServicesFound = (bonjourServices.stdout as String).contains('_dartobservatory._tcp'); expect(bonjourServicesFound, buildMode == BuildMode.debug); final ProcessResult localNetworkUsage = processManager.runSync( diff --git a/packages/flutter_tools/test/integration.shard/flutter_run_with_error_test.dart b/packages/flutter_tools/test/integration.shard/flutter_run_with_error_test.dart index 4088ce9683965..19b3bcac1b45c 100644 --- a/packages/flutter_tools/test/integration.shard/flutter_run_with_error_test.dart +++ b/packages/flutter_tools/test/integration.shard/flutter_run_with_error_test.dart @@ -52,7 +52,7 @@ void main() { transformToLines(process.stdout).listen((String line) async { stdout.writeln(line); - if (line.startsWith('A Dart VM Service on')) { + if (line.startsWith('An Observatory debugger')) { final RegExp exp = RegExp(r'http://127.0.0.1:(\d+)/'); final RegExpMatch match = exp.firstMatch(line)!; final String port = match.group(1)!; diff --git a/packages/flutter_tools/test/integration.shard/observatory_port_test.dart b/packages/flutter_tools/test/integration.shard/observatory_port_test.dart index 453ce8ca773e6..e1d4241e64c9f 100644 --- a/packages/flutter_tools/test/integration.shard/observatory_port_test.dart +++ b/packages/flutter_tools/test/integration.shard/observatory_port_test.dart @@ -20,13 +20,13 @@ Future getFreePort() async { return port; } -Future waitForVmServiceMessage(Process process, int port) async { +Future waitForObservatoryMessage(Process process, int port) async { final Completer completer = Completer(); process.stdout .transform(utf8.decoder) .listen((String line) { printOnFailure(line); - if (line.contains('A Dart VM Service on Flutter test device is available at')) { + if (line.contains('An Observatory debugger and profiler on Flutter test device is available at')) { if (line.contains('http://127.0.0.1:$port')) { completer.complete(); } else { @@ -53,43 +53,43 @@ void main() { tryToDelete(tempDir); }); - testWithoutContext('flutter run --vm-service-port', () async { + testWithoutContext('flutter run --observatory-port', () async { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final int port = await getFreePort(); - // If only --vm-service-port is provided, --vm-service-port will be used by DDS + // If only --observatory-port is provided, --observatory-port will be used by DDS // and the VM service will bind to a random port. final Process process = await processManager.start([ flutterBin, 'run', '--show-test-device', - '--vm-service-port=$port', + '--observatory-port=$port', '-d', 'flutter-tester', ], workingDirectory: tempDir.path); - await waitForVmServiceMessage(process, port); + await waitForObservatoryMessage(process, port); process.kill(); await process.exitCode; }); - testWithoutContext('flutter run --dds-port --vm-service-port', () async { + testWithoutContext('flutter run --dds-port --observatory-port', () async { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); - final int vmServicePort = await getFreePort(); + final int observatoryPort = await getFreePort(); int ddsPort = await getFreePort(); - while(ddsPort == vmServicePort) { + while(ddsPort == observatoryPort) { ddsPort = await getFreePort(); } - // If both --dds-port and --vm-service-port are provided, --dds-port will be used by - // DDS and --vm-service-port will be used by the VM service. + // If both --dds-port and --observatory-port are provided, --dds-port will be used by + // DDS and --observatory-port will be used by the VM service. final Process process = await processManager.start([ flutterBin, 'run', '--show-test-device', - '--vm-service-port=$vmServicePort', + '--observatory-port=$observatoryPort', '--dds-port=$ddsPort', '-d', 'flutter-tester', ], workingDirectory: tempDir.path); - await waitForVmServiceMessage(process, ddsPort); + await waitForObservatoryMessage(process, ddsPort); process.kill(); await process.exitCode; }); @@ -107,7 +107,7 @@ void main() { '-d', 'flutter-tester', ], workingDirectory: tempDir.path); - await waitForVmServiceMessage(process, ddsPort); + await waitForObservatoryMessage(process, ddsPort); process.kill(); await process.exitCode; }); diff --git a/packages/flutter_tools/test/integration.shard/overall_experience_test.dart b/packages/flutter_tools/test/integration.shard/overall_experience_test.dart index 3ee5ecdf73288..cb7bd83663d9e 100644 --- a/packages/flutter_tools/test/integration.shard/overall_experience_test.dart +++ b/packages/flutter_tools/test/integration.shard/overall_experience_test.dart @@ -502,7 +502,7 @@ void main() { ['run', '-dflutter-tester', testScript], testDirectory, [ - Barrier(RegExp(r'^A Dart VM Service on Flutter test device is available at: ')), + Barrier(RegExp(r'^An Observatory debugger and profiler on Flutter test device is available at: ')), Barrier(RegExp(r'^The Flutter DevTools debugger and profiler on Flutter test device is available at: '), handler: (String line) { return 'r'; }), @@ -594,7 +594,7 @@ void main() { 'c Clear the screen', 'q Quit (terminate the application on the device).', '', - startsWith('A Dart VM Service on Flutter test device is available at: http://'), + startsWith('An Observatory debugger and profiler on Flutter test device is available at: http://'), startsWith('The Flutter DevTools debugger and profiler on Flutter test device is available at: http://'), '', 'Flutter run key commands.', @@ -621,7 +621,7 @@ void main() { 'c Clear the screen', 'q Quit (terminate the application on the device).', '', - startsWith('A Dart VM Service on Flutter test device is available at: http://'), + startsWith('An Observatory debugger and profiler on Flutter test device is available at: http://'), startsWith('The Flutter DevTools debugger and profiler on Flutter test device is available at: http://'), '', 'Application finished.', diff --git a/packages/flutter_tools/test/integration.shard/test_driver.dart b/packages/flutter_tools/test/integration.shard/test_driver.dart index 0cedad7b2aa3c..07ed89f685cce 100644 --- a/packages/flutter_tools/test/integration.shard/test_driver.dart +++ b/packages/flutter_tools/test/integration.shard/test_driver.dart @@ -812,7 +812,7 @@ class FlutterTestTestDriver extends FlutterTestDriver { if (withDebugger) { final Map startedProcessParams = (await _waitFor(event: 'test.startedProcess', timeout: appStartTimeout))['params']! as Map; - final String vmServiceHttpString = startedProcessParams['vmServiceUri']! as String; + final String vmServiceHttpString = startedProcessParams['observatoryUri']! as String; _vmServiceWsUri = Uri.parse(vmServiceHttpString).replace(scheme: 'ws', path: '/ws'); await connectToVmService(pauseOnExceptions: pauseOnExceptions); // Allow us to run code before we start, eg. to set up breakpoints. diff --git a/packages/flutter_tools/test/integration.shard/xcode_backend_test.dart b/packages/flutter_tools/test/integration.shard/xcode_backend_test.dart index 36cfa614c5ad3..01484aa6c2c86 100644 --- a/packages/flutter_tools/test/integration.shard/xcode_backend_test.dart +++ b/packages/flutter_tools/test/integration.shard/xcode_backend_test.dart @@ -66,7 +66,7 @@ void main() { expect(result.exitCode, isNot(0)); }, skip: !io.Platform.isMacOS); // [intended] requires macos toolchain. - group('vmService Bonjour service keys', () { + group('observatory Bonjour service keys', () { late Directory buildDirectory; late File infoPlist; @@ -78,7 +78,7 @@ void main() { test('handles when the Info.plist is missing', () async { final ProcessResult result = await Process.run( xcodeBackendPath, - ['test_vm_service_bonjour_service'], + ['test_observatory_bonjour_service'], environment: { 'CONFIGURATION': 'Debug', 'BUILT_PRODUCTS_DIR': buildDirectory.path, @@ -102,7 +102,7 @@ void main() { final ProcessResult result = await Process.run( xcodeBackendPath, - ['test_vm_service_bonjour_service'], + ['test_observatory_bonjour_service'], environment: { 'CONFIGURATION': 'Release', 'BUILT_PRODUCTS_DIR': buildDirectory.path, @@ -112,7 +112,7 @@ void main() { final String actualInfoPlist = infoPlist.readAsStringSync(); expect(actualInfoPlist, isNot(contains('NSBonjourServices'))); - expect(actualInfoPlist, isNot(contains('dartVmService'))); + expect(actualInfoPlist, isNot(contains('dartobservatory'))); expect(actualInfoPlist, isNot(contains('NSLocalNetworkUsageDescription'))); expect(result.exitCode, 0); @@ -124,7 +124,7 @@ void main() { final ProcessResult result = await Process.run( xcodeBackendPath, - ['test_vm_service_bonjour_service'], + ['test_observatory_bonjour_service'], environment: { 'CONFIGURATION': buildConfiguration, 'BUILT_PRODUCTS_DIR': buildDirectory.path, @@ -134,7 +134,7 @@ void main() { final String actualInfoPlist = infoPlist.readAsStringSync(); expect(actualInfoPlist, contains('NSBonjourServices')); - expect(actualInfoPlist, contains('dartVmService')); + expect(actualInfoPlist, contains('dartobservatory')); expect(actualInfoPlist, contains('NSLocalNetworkUsageDescription')); expect(result.exitCode, 0); @@ -158,7 +158,7 @@ void main() { final ProcessResult result = await Process.run( xcodeBackendPath, - ['test_vm_service_bonjour_service'], + ['test_observatory_bonjour_service'], environment: { 'CONFIGURATION': 'Debug', 'BUILT_PRODUCTS_DIR': buildDirectory.path, @@ -173,7 +173,7 @@ void main() { NSBonjourServices - _dartVmService._tcp + _dartobservatory._tcp _bogus._tcp NSLocalNetworkUsageDescription