Enable goldenFileComparator
fix for on-device integration tests. (#163157)
Closes https://github.com/flutter/flutter/issues/143299. Closes https://github.com/flutter/flutter/issues/160043. A website update is work-in-progress here to add more context for users: <https://github.com/flutter/website/pull/11716>.
This commit is contained in:
parent
b61335bd3b
commit
4ff2deafd4
@ -243,6 +243,11 @@ void main() {
|
||||
buffer.write('''
|
||||
goldenFileComparator = LocalFileComparator(Uri.parse('$testUrl'));
|
||||
autoUpdateGoldenFiles = $updateGoldens;
|
||||
''');
|
||||
}
|
||||
if (integrationTest) {
|
||||
buffer.write('''
|
||||
VmServiceProxyGoldenFileComparator.useIfRunningOnDevice();
|
||||
''');
|
||||
}
|
||||
if (testConfigFile != null) {
|
||||
|
@ -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();
|
||||
|
@ -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<String, String> parameters) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user