This reverts commit ee86e61f73.
This commit is contained in:
@@ -167,12 +167,6 @@ abstract class FlutterGoldenFileComparator extends GoldenFileComparator {
|
|||||||
/// Prepends the golden URL with the library name that encloses the current
|
/// Prepends the golden URL with the library name that encloses the current
|
||||||
/// test.
|
/// test.
|
||||||
Uri _addPrefix(Uri golden) {
|
Uri _addPrefix(Uri golden) {
|
||||||
// Ensure the Uri ends in .png as the SkiaClient expects
|
|
||||||
assert(
|
|
||||||
golden.toString().split('.').last == 'png',
|
|
||||||
'Golden files in the Flutter framework must end with the file extension '
|
|
||||||
'.png.'
|
|
||||||
);
|
|
||||||
final String prefix = basedir.pathSegments[basedir.pathSegments.length - 2];
|
final String prefix = basedir.pathSegments[basedir.pathSegments.length - 2];
|
||||||
return Uri.parse('$prefix.$golden');
|
return Uri.parse('$prefix.$golden');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -481,26 +481,6 @@ void main() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('asserts .png format', () async {
|
|
||||||
await expectLater(
|
|
||||||
() async {
|
|
||||||
return comparator.compare(
|
|
||||||
Uint8List.fromList(_kTestPngBytes),
|
|
||||||
Uri.parse('flutter.golden_test.1'),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
throwsA(
|
|
||||||
isA<AssertionError>().having((AssertionError error) => error.toString(),
|
|
||||||
'description',
|
|
||||||
contains(
|
|
||||||
'Golden files in the Flutter framework must end with the file '
|
|
||||||
'extension .png.'
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('calls init during compare', () {
|
test('calls init during compare', () {
|
||||||
expect(fakeSkiaClient.initCalls, 0);
|
expect(fakeSkiaClient.initCalls, 0);
|
||||||
comparator.compare(
|
comparator.compare(
|
||||||
@@ -599,26 +579,6 @@ void main() {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('asserts .png format', () async {
|
|
||||||
await expectLater(
|
|
||||||
() async {
|
|
||||||
return comparator.compare(
|
|
||||||
Uint8List.fromList(_kTestPngBytes),
|
|
||||||
Uri.parse('flutter.golden_test.1'),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
throwsA(
|
|
||||||
isA<AssertionError>().having((AssertionError error) => error.toString(),
|
|
||||||
'description',
|
|
||||||
contains(
|
|
||||||
'Golden files in the Flutter framework must end with the file '
|
|
||||||
'extension .png.'
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('calls init during compare', () {
|
test('calls init during compare', () {
|
||||||
expect(fakeSkiaClient.tryInitCalls, 0);
|
expect(fakeSkiaClient.tryInitCalls, 0);
|
||||||
comparator.compare(
|
comparator.compare(
|
||||||
@@ -785,26 +745,6 @@ void main() {
|
|||||||
fakeSkiaClient.cleanTestNameValues['library.flutter.golden_test.1.png'] = 'flutter.golden_test.1';
|
fakeSkiaClient.cleanTestNameValues['library.flutter.golden_test.1.png'] = 'flutter.golden_test.1';
|
||||||
});
|
});
|
||||||
|
|
||||||
test('asserts .png format', () async {
|
|
||||||
await expectLater(
|
|
||||||
() async {
|
|
||||||
return comparator.compare(
|
|
||||||
Uint8List.fromList(_kTestPngBytes),
|
|
||||||
Uri.parse('flutter.golden_test.1'),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
throwsA(
|
|
||||||
isA<AssertionError>().having((AssertionError error) => error.toString(),
|
|
||||||
'description',
|
|
||||||
contains(
|
|
||||||
'Golden files in the Flutter framework must end with the file '
|
|
||||||
'extension .png.'
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('passes when bytes match', () async {
|
test('passes when bytes match', () async {
|
||||||
expect(
|
expect(
|
||||||
await comparator.compare(
|
await comparator.compare(
|
||||||
|
|||||||
Reference in New Issue
Block a user