This change implements a BundledTestRunner to run most of the tests in testing/fuchsia/test_suites.yaml as ExecutableTestRunner.
- Tests with packages out of out/fuchsia_*_x64/ are ignored for now.
- Tests with extra test command line parameters are ignored for now.
The BundledTestRunner can share most of the logic in ExecutableTestRunner and avoid reinventing the wheel.
This change also fixes the build break of fuchsia_tests in fuchsia_release_x64 which allows tests to run on the build as well.
- Tests not built with AOT are filtered out with variant field in test_suites.yaml.
Bug: https://github.com/flutter/flutter/issues/140179
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This change migrates off of the old fuchsia logging apis to use the
structured logging apis. The initial FIDL connection is made during
global initialization (before main()) and the initial minimum log level
is queried from the system. Later on, once the main loop is initialized,
we setup an async task to listen for additional log interest changes
from the system. The advantage of doing this on the main loop is that we
avoid spawning an additional background thread in the process (the
legacy logging apis use the background thread approach).
One added benefit of this change is it reduces the size of the
dart/flutter runner far packages by about 250kb in release mode, because
libsyslog.so and libbackend_fuchsia_globals.so are no longer needed.
flutter/flutter#141924
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Changes since last roll
```
58665e3dee4 Version 3.4.0-79.0.dev
6b0b4d425b0 Macro. Keep FileState for macro file, refresh if its content changes.
f4c3572c18a [deps] Rev `native` packages.
f4dae883559 [co19] Roll co19 to af2ac968c0ca28b7dd94325b00a3acf569f6e858
e2aac0b8e86 [web docs] add package:web to the main sdk docs - api.dart.dev
3d4a39e9c24 Revert "Revert two CLs that remove WithoutNullSafetyMixin usages."
20a27fee111 Fix for data driven rename when class is used in as expression
ecb5fc2228a [dart2wasm] Improve dispatch table packing from 49% to 99%
cdad90dfb81 [frontend_server] frontend_server_flutter_suite
```
Requires manual roll due to ffi package move as part of `f4c3572c18a`.
Closes https://github.com/flutter/flutter/issues/133415.
---
This is a prototype I threw together in about 1-2 hours. It enforces and
automatically fixes header guards that don't match the [the Google C++
style
guide](https://google.github.io/styleguide/cppguide.html#The__define_Guard).
For example, here is (trimmed) output at HEAD:
```txt
line 5, column 1 of impeller/aiks/picture.h: Unexpected #pragma once
╷
5 │ #pragma once
│ ^^^^^^^^^^^^
╵
line 5, column 1 of flow/stopwatch.h: Expected #ifndef FLUTTER_FLOW_STOPWATCH_H_
╷
5 │ #ifndef FLUTTER_FLOW_INSTRUMENTATION_H_
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
The following 731 files have invalid header guards:
```
Generated by https://github.com/flutter/engine/pull/48903 (`dart ./tools/header_guard_check/bin/main.dart --fix`).
As discussed with @cbracken and @jmagman, the guards are not technically needed on the Mac/iOS code, but they (a) do not hurt and (b) still provide value if for some reason `#include` is used instead of `#import` (though I suspect we could try to add that to the tool in the future as well).
Fixes https://github.com/flutter/flutter/issues/141571
Shell::Screenshot was impelemnted in a Skia-only way and would crash when invoked. Adds test coverage for the breaking path on iOS that ends up calling `FlutterView drawLayer`.
This change is a redo of https://github.com/flutter/engine/pull/49847.
https://github.com/zijiehe-google-com/engine/compare/4530942..main
should show the diff between this and the original change; mainly fixes
the https://github.com/flutter/flutter/issues/141907.
Following paragraph is copied from the original change.
This change can be executed from buildroot by
```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```
Bug: https://github.com/flutter/flutter/issues/140179
- [V] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description
above.
- [V] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
Reverts flutter/engine#49847
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
This change is a redo of https://github.com/flutter/engine/pull/49650.
https://github.com/zijiehe-google-com/engine/compare/de5c713..main should show the diff between this and the original change.
Following paragraph is copied from the original change.
This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by
```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```
Bug: https://github.com/flutter/flutter/issues/140179
- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
This change is a redo of https://github.com/flutter/engine/pull/49650.
https://github.com/zijiehe-google-com/engine/compare/de5c713..main
should show the diff between this and the original change.
Following paragraph is copied from the original change.
This change requires https://github.com/flutter/buildroot/pull/811, and
can be executed from buildroot by
```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```
Bug: https://github.com/flutter/flutter/issues/140179
## Pre-launch Checklist
- [V] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description
above.
- [V] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
The Flutter GPU tests were broken, and it turns out that I had never set them up to run on CI. This fixes the HostBuffer and gets the test suite running on CI.
Reverts flutter/engine#49650
Initiated by: CaseyHillers
This change reverts the following previous change:
Original Description:
This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by
```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```
Bug: https://github.com/flutter/flutter/issues/140179
- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This change requires https://github.com/flutter/buildroot/pull/811, and can be executed from buildroot by
```
python3 flutter/tools/fuchsia/with_envs.py flutter/testing/fuchsia/run_tests.py
```
Bug: https://github.com/flutter/flutter/issues/140179
- [V] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
- [V] I read the [Tree Hygiene] wiki page, which explains my responsibilities.
- [V] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides].
- [V] I listed at least one issue that this PR fixes in the description above.
- [V] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests.
- [V] I updated/added relevant documentation (doc comments with `///`).
- [V] I signed the [CLA].
- [V] All existing and new tests are passing.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
I plan to fix the GLES fragment program reload issue, but first want to make sure this gets some failures for it.
Added a few skips for shaders that require an extension not available on CI (mipmap related ones).
Updated a couple tests that were failing.
This enables work ongoing by @derekxu16 to improve performance in flutter_tester when running multiple files from large test suites.
Specifically, it:
- Exposes a `Spawn` C symbol from flutter_tester that runs the current kernel in a new UI isolate with a different entrypoint and/or route name
- Exposes two symbols from flutter_tester to allow a test harness to more efficiently load particular kernel files or to lookup an entrypoint from an imported source file.
- Avoids re-loading the kernel file completely when spawning a new UI isolate
Googlers can look at go/flutter-tester-isolates for some more context. If anyone wants I'm happy to create a public version of that doc.
Fixes https://github.com/flutter/flutter/issues/140481
Before this fix, if all tests are skipped, the `onDone` callback never fires, which means the recieve port never closes, which means the process just hangs indefinitely (and the success message is never printed).
Save a recording/screenshot to the uploaded xcresult when a Scenario test fails.
<img width="1052" alt="Screenshot 2023-12-14 at 6 34 47â¯PM" src="https://github.com/flutter/engine/assets/682784/c1294497-28f6-4400-b21c-da689a224dc4">
<img width="244" alt="Screenshot 2023-12-14 at 6 41 03â¯PM" src="https://github.com/flutter/engine/assets/682784/f769dd5f-a71b-4320-b9ef-64eac722166a">
No more errant spew as reported in https://github.com/flutter/engine/pull/19668 when this was originally turned off.
```
Test Case '-[StatusBarTest testTapStatusBar]' started.
t = 0.00s Start Test at 2023-12-14 18:20:34.207
...
t = 2.69s Synthesize event
t = 2.70s Find the StatusBar at {{0.0, 0.0}, {375.0, 20.0}}
t = 2.72s Find the StatusBar at {{0.0, 0.0}, {375.0, 20.0}}
t = 2.74s Find the StatusBar at {{0.0, 0.0}, {375.0, 20.0}}
t = 3.03s Wait for com.apple.springboard to idle
t = 3.43s Waiting 1.0s for "0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField to exist
t = 4.43s Checking `Expect predicate `exists == 1` for object "0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField`
t = 4.43s Checking existence of `"0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField`
t = 4.45s Capturing element debug description
t = 4.45s Checking existence of `"0,PointerChange.add,device=0,buttons=0,signalKind=PointerSignalKind.none" TextField`
/Volumes/Work/s/w/ir/cache/builder/src/out/ios_debug_sim/scenario_app/Scenarios/ScenariosUITests/StatusBarTest.m:37: error: -[StatusBarTest testTapStatusBar] : ((exists) is true) failed
t = 4.48s Tear Down
```
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8761683198070320113/+/u/test:_Scenario_App_Integration_Tests__3_/stdout
Fixes https://github.com/flutter/flutter/issues/140192
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This is part of the work towards supporting OpenGLES and Vulkan for runtime stage shaders.
Removes some redundant work we had around SkSL. Now only bundles the shaders we actually ask for from the command line.
@bdero, we should figure out if this is the right approach for flutter_gpu.
With this change, the IPLR format goes from having a root table of shader related information to a root table of shader information per `sksl`, `metal`, `opengles`, and `vulkan` platforms.
This may end up allowing us to revert https://github.com/flutter/engine/pull/47278, but I'm not sure I understand all the implications of that at this point.
I have run some but not all tests locally.
This reverts commit 87171e73397f7edfd4c145fbaebdd7208954debf.
Internal performance test shows that this PR negatively affects startup time. I'll reland this PR in parts.
b/307872797
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Today the default renderer on hosts is Skia, but if we ever change the default then we will be testing on Impeller+default(Impeller) rather than both Skia and Impeller. Change the flutter_tester launch arguments to explicitly disable Impeller when we want to test Skia so that we will always test on both platforms.
This PR implements `FlutterMetalLayer`, a drop-in (as far as Flutter is
concerned) replacement for `CAMetalLayer`. The biggest difference is
that `FlutterMetalLayer` can present frames from background thread
within a `CATransaction`.
`FlutterMetalLayer` is disabled by default. To opt-in, add the following
item to `Info.plist`:
```xml
<key>FLTUseFlutterMetalLayer</key>
<true/>
```
The performance seems quite good, consistent 120hz on iPhone 13 Pro.
Benefits
- presenting with transaction from background thread, which, down the
line, would allow for platform views without thread merging.
- fine control over how the surface is displayed - we can display single
surface on multiple `CALayers`, each showing different part, allowing
for performant implementation of unobstructed platform views.
Drawbacks
- this not being a metal layer makes working with metal instrument tools
more awkward
For consistency, I don't think we have any other tools with `-`'s.
I'll be honest - this seemed easier than teaching the header guard tool
how to handle `-`'s in directory names, but if you feel strongly about
it I can revert.
This PR adds `String? identifier` to `SemanticsUpdateBuilder` (currently it's only available in the temproary `SemanticsUpdateBuilderNew` API.
This is mainly targeted at https://github.com/flutter/flutter/issues/17988
Steps:
part 1: [engine] add `SemanticsUpdateBuilderNew` https://github.com/flutter/engine/pull/47961
part 2: [flutter] use `SemanticsUpdateBuilderNew` https://github.com/flutter/flutter/pull/138331
**part 3: [engine] update `SemanticsUpdateBuilder` to be the same as `SemanticsUpdateBuilderNew`** <-- we are here
part 4: [flutter] use (now updated) `SemanticsUpdateBuilder` again.
part 5: [engine] remove `SemanticsBuilderNew`
This benchmark includes things like allocating geometry/contents, path conversions, et cetera. It doesn't include dispatching or GPU work, but should make it easier to see improvements/regressions in the efficiency of this code.
Towards https://github.com/flutter/flutter/issues/134501.
This PR makes the following changes to the public dart:ui API:
* It adds the `FlutterView.pysicalConstraints` property that describes max and min width and height for a view. The framework is allowed to size the `FlutterView` to any `Size` that meets these constraints.
* It adds an optional `size` argument to `FlutterView.render`. The framework provides the chosen `Size` that meets the aforementioned constraints to the `render` method. If the `FlutterView.pysicalConstraints` are tight (minHeight == maxHeight and minWidth == maxWidth) the argument is optional to remain backwards compatible. In all other cases, a `Size` must be provided.
* It adds a `ViewConstraints` class, which is basically the `dart:ui` version of `BoxConstraints` (This is similar to how we have `ViewPadding` in dart:ui to mirror `EdgeInsets` from the framework). It describes the constraints of a `FlutterView`, i.e. it powers the `FlutterView.pysicalConstraints` property.
This change does not wire anything up to the embedders. For now, `FlutterView.pysicalConstraints` just returns tight constraints for the embedder-provided size of the view (`FlutterView.physicalSize`) and the size provided to `FlutterView.render` is ignored (after it is checked that it meets the constrains).
This PR enables the framework to implement the new dynamic view sizing and embedders to separately expose the new functionality to their clients.
Presubmits will fail until https://github.com/flutter/flutter/pull/138565 is submitted to the framework.
**DO NOT SUBMIT until https://github.com/flutter/flutter/pull/138648 is ready.**
Closes https://github.com/flutter/flutter/issues/138501.
---
It would be nice to turn this into a test-fixture, and create a better local environment.
Here is how to run it locally:
```bash
# The test expects you to be PWD in the `src` directory or it crashes.
cd $ENGINE_SRC
out/host_debug_unopt_arm64/flutter_tester \
--force-multithreading \
--disable-observatory \
--use-test-fonts \
--icu-data-file-path=out/host_debug_unopt_arm64/icudtl.dat \
--flutter-assets-dir=out/host_debug_unopt_arm64/gen/flutter/lib/ui/assets \
--disable-asset-fonts \
--enable-impeller \
out/host_debug_unopt_arm64/gen/canvas_test.dart.dill
# "See" the output goldens.
open out/host_debug_unopt_arm64/gen/skia_gold_canvas_test.dart
```

As part of eliminating the Flutter buildroot
(https://github.com/flutter/flutter/issues/67373), we are moving all
third-party dependencies from //third_party to //flutter/third_party.
Once all third-party dependencies have been migrated, tooling and config
will be moved and the buildroot will be eliminated altogether.
No tests changed because there is no semantic change to this PR. This is
simply relocating a dependency.
This PR moves expat, ocmock, libjpeg-turbo, libwebp, and wuffs to
//flutter/third_party.
It also deletes //third_party/fontconfig, which was unused.
The emulator tests I added yesterday are failing because the systrace python test script uses features introduced in API 29, which causes the `perfetto` invocation to fail.
It's not essential that we run this test on lower API levels, so instead I'm making the script bail out in this case.
Other than that, the shard seems to be consistently passing, so I'm removing bringup.
This test is run on Firebase Test Lab, and crashes have been reported on CI if this task executes when the activity is in a destroyed state.
See https://github.com/flutter/flutter/issues/138451