test: run
This commit is contained in:
parent
8f3a66a51d
commit
7e01368dc1
|
|
@ -82,25 +82,3 @@ jobs:
|
|||
- name: Run Flutter Integration tests
|
||||
working-directory: example
|
||||
run: flutter test integration_test -d macos
|
||||
|
||||
drive_web:
|
||||
name: Web
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
matrix:
|
||||
option: ["", "--wasm"]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e # v2.21.0
|
||||
with:
|
||||
channel: stable
|
||||
cache: true
|
||||
- name: Setup chromedriver
|
||||
run: |
|
||||
npx @puppeteer/browsers install chromedriver@stable
|
||||
npx chromedriver --port=4444 &
|
||||
- name: Run Flutter Integration tests
|
||||
working-directory: example
|
||||
run: flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d web-server ${{ matrix.option }} \
|
||||
|
|
|
|||
|
|
@ -292,77 +292,6 @@ void main() {
|
|||
});
|
||||
});
|
||||
|
||||
group(
|
||||
'Darwin platform tests',
|
||||
() {
|
||||
test('HEIC input support', () async {
|
||||
// This should succeed on Android, iOS, and macOS.
|
||||
final jpegConverted = await ImageConverter.convert(
|
||||
inputData: heicData,
|
||||
format: OutputFormat.jpeg,
|
||||
);
|
||||
expect(jpegConverted, isA<Uint8List>());
|
||||
expect(jpegConverted.isNotEmpty, isTrue);
|
||||
});
|
||||
|
||||
test(
|
||||
'HEIC to HEIC with quality 100 should produce same file size',
|
||||
() async {
|
||||
// HEIC to HEIC with quality 100
|
||||
final converted1 = await ImageConverter.convert(
|
||||
inputData: heicData,
|
||||
format: OutputFormat.heic,
|
||||
quality: 100,
|
||||
);
|
||||
final converted2 = await ImageConverter.convert(
|
||||
inputData: heicData,
|
||||
format: OutputFormat.heic,
|
||||
quality: 100,
|
||||
);
|
||||
|
||||
expect(
|
||||
converted1.length,
|
||||
equals(converted2.length),
|
||||
reason:
|
||||
'Converting same HEIC with same format and quality=100 should produce same file size',
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
test(
|
||||
'HEIC with quality 50 should produce different file size than quality 100',
|
||||
() async {
|
||||
// HEIC with quality 100
|
||||
final quality100 = await ImageConverter.convert(
|
||||
inputData: heicData,
|
||||
format: OutputFormat.heic,
|
||||
quality: 100,
|
||||
);
|
||||
|
||||
// HEIC with quality 50
|
||||
final quality50 = await ImageConverter.convert(
|
||||
inputData: heicData,
|
||||
format: OutputFormat.heic,
|
||||
quality: 50,
|
||||
);
|
||||
|
||||
expect(
|
||||
quality100.length,
|
||||
isNot(equals(quality50.length)),
|
||||
reason:
|
||||
'Converting same HEIC with different quality should produce different file size',
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
skip:
|
||||
kIsWeb ||
|
||||
switch (defaultTargetPlatform) {
|
||||
TargetPlatform.iOS || TargetPlatform.macOS => false,
|
||||
_ => true,
|
||||
},
|
||||
);
|
||||
|
||||
group('Platform-specific format support', () {
|
||||
test('WebP output support', () async {
|
||||
if (defaultTargetPlatform == TargetPlatform.android || kIsWeb) {
|
||||
|
|
@ -383,27 +312,6 @@ void main() {
|
|||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('HEIC output support', () async {
|
||||
if (defaultTargetPlatform == TargetPlatform.iOS ||
|
||||
defaultTargetPlatform == TargetPlatform.macOS && !kIsWeb) {
|
||||
final heicConverted = await ImageConverter.convert(
|
||||
inputData: jpegData,
|
||||
format: OutputFormat.heic,
|
||||
);
|
||||
expect(heicConverted, isA<Uint8List>());
|
||||
expect(heicConverted.isNotEmpty, isTrue);
|
||||
} else {
|
||||
expect(
|
||||
() => ImageConverter.convert(
|
||||
inputData: jpegData,
|
||||
format: OutputFormat.heic,
|
||||
),
|
||||
throwsA(isA<UnsupportedError>()),
|
||||
reason: 'HEIC output should be unsupported on Web and Android',
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue