-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(android): add simple test to avoid using androidx.core.graphics.…
…decodeBitmap
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
void main() { | ||
test( | ||
'ensure compatibility by avoiding unresolved image decoder import (See https://github.com/singerdmx/flutter-quill/issues/2340)', | ||
() { | ||
// TODO: Avoid hardcoding the `dev/flutterquill/quill_native_bridge/` | ||
// in here and in pigeons/messages.dart | ||
final targetDirectory = Directory( | ||
'android/src/main/kotlin/dev/flutterquill/quill_native_bridge/'); | ||
|
||
expect(targetDirectory.existsSync(), isTrue, | ||
reason: 'Target directory does not exist: ${targetDirectory.path}'); | ||
|
||
for (final entity in targetDirectory.listSync(recursive: true)) { | ||
if (entity is! File) { | ||
continue; | ||
} | ||
final content = entity.readAsStringSync(); | ||
expect( | ||
content.contains('import androidx.core.graphics.decodeBitmap'), | ||
isFalse, | ||
reason: 'Compatibility issue detected in ${entity.path}. ' | ||
'Avoid using `androidx.core.graphics.decodeBitmap`. ' | ||
'For more details, see https://github.com/FlutterQuill/quill-native-bridge/pull/7', | ||
); | ||
} | ||
}, | ||
); | ||
} |