Sets up rules to create an APK that is comprised of solely native code. Existing executable targets (like GTests) can then use this to run on Android devices while having access to activities, windows, etc.. This allows for broader test coverage. Basically, anything that needed an ANativeWindow could only be tested in an integration test.
Executables that need access to the native activity must provide an implementation of `NativeActivityMain` that returns a custom subclass of `flutter::NativeActivity`. The `native_activity_apk` reads like an `executable` or `shared_library` target. Just one that packages that executable in an APK.
The APK is built using the Android Tools and does not use Gradle. Creating a new APK after invalidating some code takes ~200ms on my machine. The edit, compile, run cycle for only a tiny bit worse than testing on the host.
Builds on top of this new infrastructure to create a `GTestActivity` that runs an existing test suites. This works really well except the GTest suite logs to `STDOUT` whereas the engine logs to `logcat`. To quickly work around this, a custom test status listener has been wired up. This only displays the test results to logcat today but a similar mechanism can be used to talk to the test runner in the host. I will wire this up in an upcoming patch as there is no hooks into this from CI right now.
Creates an APK variant of the `impeller_toolkit_android_unittests` harness.
Reverts: flutter/engine#51439
Initiated by: zijiehe-google-com
Reason for reverting: broke dart->flutter roller due to the expected licenses not being included without `download_fuchsia_deps` in `.gclient`.
Original PR Author: zijiehe-google-com
Reviewed By: {zanderso}
This change reverts the following previous change:
This is a quick follow up of https://github.com/flutter/engine/pull/51072 to only download fuchsia deps (via download_fuchsia_deps gclient arg) when necessary. Considering the pr/51072 is very huge, keeping these condition changes in a separate change would be cleaner.
The wiki has been updated already since setting the download_fuchsia_deps gclient arg explicitly won't break the existing workflow. I also mentioned in the wiki that building and running fuchsia needed a linux box (an explicit assertion in the with_envs.py).
Bug: http://b/40935282
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
The `js_util.jsify()` related code shows up in CPU profile of wonderous.
=> Any `SkwasmObjectWrapper` object invokes this logic in the
constructor and dispose method.
This PR
* makes `DomFinalizationRegistryExtension` accept `JSAny` types instead
of Dart types and internally converting
=> Callsites can call more precise `<>.toJS*` extension methods
=> Will avoids extra type checks on the objects when we can call
`Object.toJSBox` directly
* makes us use a `toJSWrapper` / `fromJSWrapper` which will not delegate to a recursive `jsify()` but simply externalize the wasm gc object
=> We cannot use `Object.toJSBox` due to it being slower to create JS
boxes as it semantically does something different atm (see issue below)
=> Instead use conditional import of `dart:_wasm` which provides the
necessary primitives
=> Similar for going from JS to Dart.
* Avoid converting from Dart object to `JSAny` more than needed
(we did the operation twice for each registration and once for
unregistration)
Issue https://github.com/dart-lang/sdk/issues/55183
Remove the `Tappable` role from the `PrimaryRoleManager.withBasics` constructor. Only add `Tappable` to primary roles that know for sure they need it.
Fixes https://github.com/flutter/flutter/issues/144364
This is a quick follow up of https://github.com/flutter/engine/pull/51072 to only download fuchsia deps (via download_fuchsia_deps gclient arg) when necessary. Considering the pr/51072 is very huge, keeping these condition changes in a separate change would be cleaner.
The wiki has been updated already since setting the download_fuchsia_deps gclient arg explicitly won't break the existing workflow. I also mentioned in the wiki that building and running fuchsia needed a linux box (an explicit assertion in the with_envs.py).
Bug: http://b/40935282
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This reverts commit 037aa6b4caa6a3a726e67e519324b2c0a1ec274a.
The original cause of the revert was a flake introduced because the unit-test could request a frame from the Choreographer if it ran long enough. The availability checks in the choreographer were inaccurate after we intentionally backed out of using the Callback32 variant on 32 bit platforms.
The new tests didn't catch it because of an unrelated issue. In the first version of the patch for review, the proc table was only supposed to run on API levels 29 and above. When @dnfield requested we also get rid of the NDK helpers, the choreographer and additional utilities were added. But the API level gate in the new test harness wasn't removed. This made the tests be skipped. That gate has been removed entirely now. The error that cause the revert because of flakiness will now be a reliable failure.
Work towards https://github.com/flutter/flutter/issues/145219.
Previously all logging would be silent in the case that `test_foo` uploads a digest that is considered "untriaged", and we'd be entirely reliant on the `flutter-gold` check to pick this up asynchronously.
As part of debugging https://github.com/flutter/flutter/issues/145219 (but probably to keep this code indefinitely, it's not harmful), we now unconditionally log the swallowed failures to `stderr` so they will show up in our LUCI logs.
/cc @gaaclarke @jonahwilliams
Only available on Android device API levels >= 29. Proc table is setup has versioning checks. All handles are type safe. Collection of handles takes into account cleanup tasks (like reparenting surface controls). The proc table contains code duplicated in ndk_helpers and I will remove that in favor of this in a subsequent patch.
Part of https://github.com/flutter/engine/pull/51213 being chopped up.
Previously the DisplayListBuilder would only pass along bounds for a saveLayer when they were supplied by the caller that was building the DisplayList. This would require Impeller to use post-processing of the EntityPass lists to compute them on its own.
DisplayList can now compute those bounds as it builds the DisplayList to save dispatch clients from having to do so on their own. It will also provide an indicator in the case when the caller supplied bounds that ended up being too small to capture all of the content, causing clipping by the layer render target.
Closes https://github.com/flutter/flutter/issues/144365.
Wasn't able to delete as much as I wanted (it's used by the video-rendering code path), but it should fix the problem we're seeing. I expect this change to remove the bottom (Android-rendered) image from our golden files for `ExternalTexturesTests`.
### Motivation of the change:
Both dart and flutter are using fairly outdated gn-sdk without properly maintained. Currently @hjfreyer is working on version'ed IDK / SDK libs which requires changes in gn-sdk to use the right version of the libs in fuchsia/sdk/obj/{arch}-api-{level} rather than the one in the fuchsia/sdk/arch. But current implementation does not support choosing the right version.
### Blocking issue:
The new gn-sdk (in flutter/tools/fuchsia/gn-sdk) generates multiple BUILD.gn files rather than a large BUILD.gn the previous version created. So most of the build rules need to switch from the old `fidl:{api}` build rule to `fidl/{api}` rule. The same change will happen in the dart/sdk, i.e. http://go/dart-reviews/356924. But since the two repos cannot have one single atomic change, changing either side first will cause flutter to break. E.g. the linkage error caused by duplicated symbols will happen if we change the dart/sdk first, since in flutter, it will still refer to the old build rules in the middle.
### Solutions:
Ideally we can create redirect rules in the current `build/fuchsia` buildroot tree to redirect the old rules into the new one, so we can make the change in the flutter first then dart/sdk. But creating the rules is not trivial and will only be used once.
So an alternative solution is
- pause the dart/sdk -> flutter roll
- submit dart/sdk change (http://go/dart-reviews/356924)
- update this change to manually bring the dart/sdk change, namely the `dart_revision` in the DEPS file and signatures in the ci/licences.
- resume the dart/sdk -> flutter roll.
But it requires this change itself to be reviewed first, and I'd like to know your opinion before moving forward.
See corresponding dart/sdk change at http://go/dart-reviews/356924.
### //build/fuchsia/ from buildroot should be removed after this change.
Bug: [b/40935282](https://issues.chromium.org/issues/40935282?pli=1&authuser=0)
FYI: @hjfreyer
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Reverts: flutter/engine#51429
Initiated by: bdero
Reason for reverting: Engine tree breakage
```
+ /b/s/w/ir/cache/builder/src/out/host_release/display_list_region_benchmarks --benchmark_format=json
/b/s/w/ir/cache/builder/src/flutter/testing/benchmark/generate_metrics.sh: line 17: /b/s/w/ir/cache/builder/src/out/host_release/display_list_region_benchmarks: No such file or directory
```
Original PR Author: flar
Reviewed By: {godofredoc}
This change reverts the following previous change:
These benchmark results aren't shown in Skia perf because they were never added to the CI tasks to run.
- Replaced manual `StringBuffer()..writeln('stdout: ...')` with a single
`SkiaGoldProcessError` constructor.
- Updated tests to make sure it's working.
_/cc @dnfield @jonahwilliams FYI only._