mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Removed no-shuffle tag and fixed leak in flutter_goldens_test.dart (#92374)
This commit is contained in:
parent
ea4e85dd96
commit
f091654fb4
@ -2,12 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// TODO(gspencergoog): Remove this tag once this test's state leaks/test
|
||||
// dependencies have been fixed.
|
||||
// https://github.com/flutter/flutter/issues/85160
|
||||
// Fails with "flutter test --test-randomize-ordering-seed=123"
|
||||
@Tags(<String>['no-shuffle'])
|
||||
|
||||
// See also dev/automated_tests/flutter_test/flutter_gold_test.dart
|
||||
|
||||
import 'dart:async';
|
||||
@ -35,13 +29,6 @@ const List<int> _kTestPngBytes =
|
||||
120, 1, 99, 97, 0, 2, 0, 0, 25, 0, 5, 144, 240, 54, 245, 0, 0, 0, 0, 73, 69,
|
||||
78, 68, 174, 66, 96, 130];
|
||||
|
||||
// 1x1 colored pixel
|
||||
const List<int> _kFailPngBytes =
|
||||
<int>[137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0,
|
||||
1, 0, 0, 0, 1, 8, 6, 0, 0, 0, 31, 21, 196, 137, 0, 0, 0, 13, 73, 68, 65, 84,
|
||||
120, 1, 99, 249, 207, 240, 255, 63, 0, 7, 18, 3, 2, 164, 147, 160, 197, 0,
|
||||
0, 0, 0, 73, 69, 78, 68, 174, 66, 96, 130];
|
||||
|
||||
void main() {
|
||||
late MemoryFileSystem fs;
|
||||
late FakePlatform platform;
|
||||
@ -573,22 +560,6 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('compare properly awaits validation & output before failing.', () async {
|
||||
final Completer<bool> completer = Completer<bool>();
|
||||
final Future<bool> result = comparator.compare(
|
||||
Uint8List.fromList(_kFailPngBytes),
|
||||
Uri.parse('flutter.golden_test.1.png'),
|
||||
);
|
||||
bool shouldThrow = true;
|
||||
result.then((_) {
|
||||
if (shouldThrow)
|
||||
fail('Compare completed before validation completed!');
|
||||
});
|
||||
await Future<void>.value();
|
||||
shouldThrow = false;
|
||||
completer.complete(Future<bool>.value(false));
|
||||
});
|
||||
|
||||
test('returns FlutterSkippingGoldenFileComparator when network connection is unavailable', () async {
|
||||
final FakeDirectory fakeDirectory = FakeDirectory();
|
||||
fakeDirectory.existsSyncValue = true;
|
||||
@ -611,6 +582,8 @@ void main() {
|
||||
baseDirectory: fakeDirectory,
|
||||
);
|
||||
expect(comparator.runtimeType, FlutterSkippingFileComparator);
|
||||
// reset property or it will carry on to other tests
|
||||
fakeSkiaClient.getExpectationForTestThrowable = null;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user