diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index d06ec1202cb..99b1fa9d79c 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -243,6 +243,11 @@ void main() { buffer.write(''' goldenFileComparator = LocalFileComparator(Uri.parse('$testUrl')); autoUpdateGoldenFiles = $updateGoldens; +'''); + } + if (integrationTest) { + buffer.write(''' + VmServiceProxyGoldenFileComparator.useIfRunningOnDevice(); '''); } if (testConfigFile != null) { diff --git a/packages/integration_test/example/integration_test/matches_golden_test.dart b/packages/integration_test/example/integration_test/matches_golden_test.dart index 72f0399da32..0172b971bd2 100644 --- a/packages/integration_test/example/integration_test/matches_golden_test.dart +++ b/packages/integration_test/example/integration_test/matches_golden_test.dart @@ -24,9 +24,6 @@ import 'package:integration_test_example/main.dart' as app; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - // TODO(matanlurey): Make this automatic as part of the bootstrap. - VmServiceProxyGoldenFileComparator.useIfRunningOnDevice(); - testWidgets('can use matchesGoldenFile with integration_test', (WidgetTester tester) async { // Build our app and trigger a frame. app.main(); diff --git a/packages/integration_test/lib/src/vm_service_golden_client.dart b/packages/integration_test/lib/src/vm_service_golden_client.dart index 3c73f9c10de..8e8b0299e8e 100644 --- a/packages/integration_test/lib/src/vm_service_golden_client.dart +++ b/packages/integration_test/lib/src/vm_service_golden_client.dart @@ -12,7 +12,6 @@ import 'dart:io' as io; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:meta/meta.dart'; /// Compares image pixels against a golden image file on the host system. /// @@ -65,7 +64,6 @@ import 'package:meta/meta.dart'; /// See also: /// /// * [matchesGoldenFile], the function that invokes the comparator. -@experimental final class VmServiceProxyGoldenFileComparator extends GoldenFileComparator { VmServiceProxyGoldenFileComparator._() : _postEvent = dev.postEvent { dev.registerExtension(_kServiceName, (_, Map parameters) {