Skip to content

Conversation

@yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Nov 21, 2023

FakeView wraps the same underlying FlutterView. Sending semantics updates and Scene objects from multiple fake views into the same engine FlutterView violates contracts with the engine. This PR stubs out render and updateSemantics methods in FakeView classes to prevent that.

This unblocks flutter/engine#48251, which implements multi-view semantics for web.

@yjbanov yjbanov requested a review from goderbauer November 21, 2023 23:05
@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) labels Nov 21, 2023
Copy link
Member

@goderbauer goderbauer Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will stop sending all scenes to the engine for all tests - even the ones that belong to the implicit view since the test framework is wrapping the implicit view with a TestFlutterView. I would expect this to break a bunch of things: certain screenshot tests, flutter runing a test and watching it run on device, etc.

I was expecting that we would only mock this out for FakeView subclasses that don't correspond to engine-side views? Normal TestFlutterView that do correspond to an engine-side view, likely need to continue calling this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't know this. Should I create a TestStubbedFlutterView that does not send anything to the FlutterView? Then FakeView can inherit from that. Or actually, all FakeViews are the same, so I can just dedupe that code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable. This could likely be a class we don't expose in our public API, right? If it just lives somewhere under packages/flutter/test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packages/flutter/test SGTM as a location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out packages/flutter_test also has its own FakeView, so I added one there too.

@yjbanov yjbanov force-pushed the fix-fake-view-semantics branch from 8dea1fa to 167a314 Compare November 22, 2023 19:24
@yjbanov yjbanov requested a review from goderbauer November 22, 2023 19:27
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yjbanov yjbanov added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 22, 2023
@auto-submit auto-submit bot merged commit 14549b3 into flutter:master Nov 22, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 22, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 22, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 22, 2023
Manual roll requested by [email protected]

flutter/flutter@ab721f9...14549b3

2023-11-22 [email protected] make FakeView not send Scene and semantics to the engine (flutter/flutter#138849)
2023-11-22 [email protected] Update the default outline color for `OutlinedButton` (flutter/flutter#138768)
2023-11-22 [email protected] Roll Flutter Engine from c954a64c509b to 342fb003b11f (1 revision) (flutter/flutter#138903)
2023-11-22 [email protected] Roll Packages from c9933fc to 2102327 (3 revisions) (flutter/flutter#138895)
2023-11-22 [email protected] Marks Mac_build_test flutter_gallery__transition_perf_e2e_ios to be unflaky (flutter/flutter#138886)
2023-11-22 [email protected] Roll Flutter Engine from d55b673f895c to c954a64c509b (1 revision) (flutter/flutter#138894)
2023-11-22 [email protected] Add `commandHasTerminal` parameter + apple usage event + `sendException` events for `package:unified_analytics` (flutter/flutter#138806)
2023-11-22 [email protected] Roll Flutter Engine from 6c8f7b566a22 to d55b673f895c (1 revision) (flutter/flutter#138890)
2023-11-22 [email protected] Roll Flutter Engine from dda2499df48a to 6c8f7b566a22 (1 revision) (flutter/flutter#138875)
2023-11-22 [email protected] Roll Flutter Engine from 1ae1d5318257 to dda2499df48a (4 revisions) (flutter/flutter#138872)
2023-11-22 [email protected] Roll Flutter Engine from 7cf9d90d59e1 to 1ae1d5318257 (8 revisions) (flutter/flutter#138861)
2023-11-22 [email protected] Revert "Reland VelocityTracker update (again)" (flutter/flutter#138863)
2023-11-21 [email protected] In `flutter doctor -v`, when JRE is too out-of-date to run `sdkmanager`, print a helpful error message (flutter/flutter#138762)
2023-11-21 [email protected] Roll Flutter Engine from a8e9b8dd562b to 7cf9d90d59e1 (1 revision) (flutter/flutter#138847)
2023-11-21 [email protected] Roll Flutter Engine from 90d1ff04ae02 to a8e9b8dd562b (1 revision) (flutter/flutter#138846)
2023-11-21 [email protected] Reland VelocityTracker update (again) (flutter/flutter#138843)
2023-11-21 [email protected] Roll Flutter Engine from 31799868224d to 90d1ff04ae02 (2 revisions) (flutter/flutter#138844)
2023-11-21 [email protected] Fix M3 Tabs Specs links (flutter/flutter#138808)
2023-11-21 [email protected] Roll Flutter Engine from 0c2de1e8849c to 31799868224d (1 revision) (flutter/flutter#138840)
2023-11-21 [email protected] Roll Flutter Engine from 746697c27569 to 0c2de1e8849c (1 revision) (flutter/flutter#138834)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
auto-submit bot pushed a commit that referenced this pull request Nov 27, 2023
Towards #134501.

Required to roll flutter/engine#48090 into the framework.

Two new subclasses of FlutterView were added recently for testing (in #138849) that I missed in my previous PR (#138565).
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
)

`FakeView` wraps the same underlying `FlutterView`. Sending semantics updates and Scene objects from multiple fake views into the same engine `FlutterView` violates contracts with the engine. This PR stubs out `render` and `updateSemantics` methods in `FakeView` classes to prevent that.

This unblocks flutter/engine#48251, which implements multi-view semantics for web.
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
Towards flutter#134501.

Required to roll flutter/engine#48090 into the framework.

Two new subclasses of FlutterView were added recently for testing (in flutter#138849) that I missed in my previous PR (flutter#138565).
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants