From e84b4c47b87801feb240f40c159dd1f3a79f591a Mon Sep 17 00:00:00 2001 From: sjindel-google Date: Thu, 25 Apr 2019 17:13:26 +0200 Subject: [PATCH] Allow all tests to run with --update-goldens. (#31562) Previously benchmark_test.dart would break if run with --update-goldens. Now the entire test suite can be run with --update-goldens. --- packages/flutter_test/lib/src/binding.dart | 6 ------ packages/flutter_test/lib/src/goldens.dart | 1 - 2 files changed, 7 deletions(-) diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index 50d4b165d0..f425d60c54 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -1106,12 +1106,6 @@ enum LiveTestWidgetsFlutterBindingFramePolicy { /// doesn't trigger a paint, since then you could not see anything /// anyway.) class LiveTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding { - @override - void initInstances() { - super.initInstances(); - assert(!autoUpdateGoldenFiles); - } - @override bool get inTest => _inTest; bool _inTest = false; diff --git a/packages/flutter_test/lib/src/goldens.dart b/packages/flutter_test/lib/src/goldens.dart index fb2a208943..6672755ce0 100644 --- a/packages/flutter_test/lib/src/goldens.dart +++ b/packages/flutter_test/lib/src/goldens.dart @@ -124,7 +124,6 @@ class TrivialComparator implements GoldenFileComparator { @override Future update(Uri golden, Uint8List imageBytes) { - // [autoUpdateGoldenFiles] should never be set in a live widget binding. throw StateError('goldenFileComparator has not been initialized'); } }