Skip to content

Commit 4c079a6

Browse files
authored
Remove the tests for rotate and crop from the Android scenario_app. (flutter#51769)
Closes flutter#145957. As @jonahwilliams and @johnmccutchan and I discussed (flutter#144407), the functionality that was being tested was actually _Android's_ ability to rotate and crop `SurfaceTexture`-backed textures. This same functionality doesn't even exist in the `ImageReader`-based textures (read: modern Android devices): > Due to an oversight by Android, ImageReader backed surfaces do not respect metadata applied to the surface (rotation & crop). Rotation information is not available at all and crop information is corrupted by the ImageReader (only the width/height is propagated the origin offset is not). We might decide to re-add this functionality in the Dart `Texture` widget, but given we'll be migrating our plugins to `SurfaceProducer` (again, read: using `ImageTexture` for most Android phones), it's pointless to test this (and isn't even testing Flutter's code). This reduces our test suite significantly (8 tests down to 2), which should also help with runtime and flakiness. /cc @zanderso who I'm sure will be stoked.
1 parent 2d53384 commit 4c079a6

6 files changed

Lines changed: 56 additions & 105 deletions

File tree

testing/scenario_app/android/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,32 @@ device (you might find it easier trying the `stdout` of the test first, which
355355
uses rudimentary log filtering). In the case of multiple runs, the logs are
356356
prefixed with the test configuration and run attempt.
357357
358+
### Gradle is failing due to an "not part of the dependency lock state" error
359+
360+
If you update dependencies in the `app/build.gradle` file, you may encounter an
361+
error (probably in CI) that looks like:
362+
363+
```txt
364+
FAILED: scenario_app/reports/lint-results.xml
365+
vpython3 ../../flutter/testing/rules/run_gradle.py /b/s/w/ir/cache/builder/src/flutter/testing/scenario_app/android lint --no-daemon -Pflutter_jar=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/flutter.jar -Pout_dir=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/scenario_app --project-cache-dir=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/scenario_app/.gradle --gradle-user-home=/b/s/w/ir/cache/builder/src/out/android_emulator_skia_debug_x64/scenario_app/.gradle
366+
367+
FAILURE: Build failed with an exception.
368+
369+
* What went wrong:
370+
Execution failed for task ':app:checkDebugAarMetadata'.
371+
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
372+
> Resolved 'org.hamcrest:hamcrest-core:1.3' which is not part of the dependency lock state
373+
> Resolved 'com.google.code.findbugs:jsr305:2.0.2' which is not part of the dependency lock state
374+
```
375+
376+
This is because [`gradle.lockfile`](./app/gradle.lockfile) is out of date. To
377+
update it, run:
378+
379+
```sh
380+
cd testing/scenario_app/android
381+
$ENGINE_SRC/third_party/gradle/bin/gradle app:dependencies --write-locks
382+
```
383+
358384
## Getting Help
359385
360386
To suggest changes, or highlight problems, please [file an issue](https://github.com/flutter/flutter/issues/new?labels=e:%20scenario-app,engine,platform-android,fyi-android,team-engine).

testing/scenario_app/android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ dependencies {
5959
}
6060
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
6161
implementation 'com.google.android.material:material:1.0.0'
62+
implementation 'androidx.test.ext:junit:1.1.5'
6263
androidTestImplementation 'junit:junit:4.12'
6364
androidTestImplementation 'androidx.test:runner:1.2.0'
6465
androidTestImplementation 'androidx.test:rules:1.2.0'

0 commit comments

Comments
 (0)