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
The difference between this PR and the original is the change to the `AndroidManifest.xml`. For context, right before the original PR landed, [a change to upgrade the target sdk](https://github.com/flutter/engine/pull/47683) in the manifest from 31 to 33 landed. It also removed the lint complaining about using an old target sdk version from the baseline lint file. So this change upgrading the sdk, but not the target sdk in the manifest, triggered the lint again.
For the rest of the PR, [see the description of the original PR](https://github.com/flutter/engine/pull/47609).
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
## Description
This moves the state update to only happen on realizing the window instead of at initialization time, based on [the comment from](https://github.com/flutter/flutter/issues/137262#issuecomment-1792020246) @robert-ancell .
## Related Issues
- https://github.com/flutter/flutter/issues/137262
## Tests
- I tried to add tests, but it doesn't seem possible to create a view without an actual display connected (and making a mock of it defeats the purpose of the test). I'm happy to be proven wrong, though.
Reverts flutter/engine#47609
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
~**This should not land until https://github.com/flutter/buildroot/pull/790 (re)lands, and I swap the buildroot url back to the latest commit.**~ ~Reland of PR to update buildroot at https://github.com/flutter/buildroot/pull/792. ~ <- landed, and changed the buildroot commit to the latest in DEPS
Upgrades to android api 34
Also:
1. Upgrades to java 17 in DEPS/ci, because the linter now requires it.
2. Stops running some roboelectric tests on android apis 16-18, because Roboelectric indicated those versions were unsupported and we don't support them either.
3. Applies the four trivial new suggestions from the newer linter.
4. Updates the baseline lint to include the new non-trivial lint ([fixed in a different PR](https://github.com/flutter/engine/pull/47817/files)).
5. Changes some instances where we were hardcoding android apis as numbers (e.g. `sdk = 16') to use version codes (see the [comment below](https://github.com/flutter/engine/pull/47609#issuecomment-1800308658)).
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Factors out an RAII-based class that can be used to capture std::cout, std::cerr, or technically any other std::ostream, though that's unlikely to be useful.
This makes the logic reusable but more importantly, ensures the capture is cleaned up at the end of the test.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
The new `BUILD.gn` files in the Engine tree can't go under
`build/secondary` because Skia still has its own, and they'd be selected
first. So, this PR puts the new `BUILD.gn` files under `flutter/skia`.
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 removes skips for the golden tests in `//testing/dart/canvas_test.dart` and instead passes them up to Skia gold.
Adds a utility class for dealing with Skia gold from these tests, as well as the existing fuzzy identical image comparison for tests that just want to do in memory comparison of images generated from the same test.
Removes the old golden files that were in tree.
Part of https://github.com/flutter/flutter/issues/53784
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.
Adds a gtest test fixture mixin and convenience class that instantiates an NSAutoreleasePool at the beginning of each test and flushes it at the end; this allows Objective-C tests using ARC to free allocations at the end of each test.
Adds a subclass for the macOS accessibility bridge tests that instantiates and re-uses an NSWindow* across any tests that use it. This is because instantiating, closing, and immediately collecting an NSWindow results in a crash.
Prior to this patch, tests started failing (on my machine) around the 855th iteration, and issued the following warning on the 101st iteration:
```
2023-10-26 13:02:45.390829-0700 flutter_desktop_darwin_unittests[40837:1509026] [Window] WARNING: NSWindow has detected an excessive live window count of 101. Window 0x1423 of class 'NSWindow' created after passing the threshold of 100. This window is not necessarily the cause, and this warning will only be shown once per window class. (
0 AppKit 0x0000000192820d28 -[NSWindow _setWindowNumber:] + 684
1 AppKit 0x00000001933050e4 _NXCreateWindow + 284
2 AppKit 0x0000000192901ae0 -[NSWindow _commonAwake] + 672
3 AppKit 0x000000019281ff00 -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 972
4 AppKit 0x000000019281f798 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 796
5 AppKit 0x000000019281f470 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 48
6 flutter_desktop_darwin_unittests 0x0000000100001e3c _ZN7flutter7testing89AccessibilityBridgeMacTest_SendsAccessibilityCreateNotificationToWindowOfFlutterView_Test8TestBodyEv + 328
```
See: http://www.openradar.me/FB13291861
Issue: https://github.com/flutter/flutter/issues/104789
Issue: https://github.com/flutter/flutter/issues/127441
Issue: https://github.com/flutter/flutter/issues/124840
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style