Repository navigation
Commit ca7bea9
authored
iOS: Eliminate use of IOSContextNoop in platform view tests (flutter#190419)
`FlutterPlatformViewsTest` used the internal engine class
`flutter::IOSContextNoop` in a dozen places purely as a no-op context to
hand to `submitFrame:withIosContext:`. This replaces those with a local
`FakeIOSContext` that replicates the behaviour the tests rely on so that
we can delete `IOSContextNoop` in a follow-up.
Like `IOSContextNoop` `FakeIOSContext` reports the Impeller backend and
returns no external texture, and inherits the null Impeller/Aiks
contexts from the base class. The one place that uses the engine's real
context (`GetIosContext`) is left untouched. I suspect we can eventually
move this code to use the real Metal backend but for now, this is just
refactoring with no semantic change.
Back in ancient times, before the simulator required Metal, and when iOS
still had a Skia software renderer, we ran that on the Simulator due to
some issues with our OpenGL implementation. Later, Flutter on iOS
migrated from Skia to Impeller. Skia supports a software backend but
Impeller did not, and so when running on Impeller, we stubbed out the
software backend to no-op context/surfaces, hence IOSContextNoop and
IOSSurfaceNoop. The Simulator now *requires* Metal and Flutter has
eliminated Skia support altogether so there's no longer a software mode
at all, nor a need for a no-op path in case you're using Impeller and
ask for a software backend.
This is part of a series of changes to remove the dead no-op fallback.
No behavioural change; just a test refactoring.
Issue: flutter#190041
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.
**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md1 parent b29df1d commit ca7bea9
1 file changed
Lines changed: 42 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
34 | 55 | | |
35 | 56 | | |
36 | 57 | | |
| |||
4225 | 4246 | | |
4226 | 4247 | | |
4227 | 4248 | | |
4228 | | - | |
4229 | | - | |
4230 | | - | |
| 4249 | + | |
| 4250 | + | |
4231 | 4251 | | |
4232 | 4252 | | |
4233 | 4253 | | |
| |||
4242 | 4262 | | |
4243 | 4263 | | |
4244 | 4264 | | |
4245 | | - | |
4246 | | - | |
4247 | | - | |
| 4265 | + | |
| 4266 | + | |
4248 | 4267 | | |
4249 | 4268 | | |
4250 | 4269 | | |
| |||
4431 | 4450 | | |
4432 | 4451 | | |
4433 | 4452 | | |
4434 | | - | |
4435 | | - | |
4436 | | - | |
| 4453 | + | |
| 4454 | + | |
4437 | 4455 | | |
4438 | 4456 | | |
4439 | 4457 | | |
| |||
4460 | 4478 | | |
4461 | 4479 | | |
4462 | 4480 | | |
4463 | | - | |
4464 | | - | |
4465 | | - | |
| 4481 | + | |
| 4482 | + | |
4466 | 4483 | | |
4467 | 4484 | | |
4468 | 4485 | | |
| |||
4535 | 4552 | | |
4536 | 4553 | | |
4537 | 4554 | | |
4538 | | - | |
4539 | | - | |
4540 | | - | |
| 4555 | + | |
| 4556 | + | |
4541 | 4557 | | |
4542 | 4558 | | |
4543 | 4559 | | |
| |||
4564 | 4580 | | |
4565 | 4581 | | |
4566 | 4582 | | |
4567 | | - | |
4568 | | - | |
4569 | | - | |
| 4583 | + | |
| 4584 | + | |
4570 | 4585 | | |
4571 | 4586 | | |
4572 | 4587 | | |
| |||
5015 | 5030 | | |
5016 | 5031 | | |
5017 | 5032 | | |
5018 | | - | |
5019 | | - | |
5020 | | - | |
| 5033 | + | |
| 5034 | + | |
5021 | 5035 | | |
5022 | 5036 | | |
5023 | 5037 | | |
| |||
5042 | 5056 | | |
5043 | 5057 | | |
5044 | 5058 | | |
5045 | | - | |
5046 | | - | |
5047 | | - | |
| 5059 | + | |
| 5060 | + | |
5048 | 5061 | | |
5049 | 5062 | | |
5050 | 5063 | | |
| |||
5108 | 5121 | | |
5109 | 5122 | | |
5110 | 5123 | | |
5111 | | - | |
| 5124 | + | |
5112 | 5125 | | |
5113 | 5126 | | |
5114 | 5127 | | |
| |||
5174 | 5187 | | |
5175 | 5188 | | |
5176 | 5189 | | |
5177 | | - | |
| 5190 | + | |
5178 | 5191 | | |
5179 | 5192 | | |
5180 | 5193 | | |
| |||
5243 | 5256 | | |
5244 | 5257 | | |
5245 | 5258 | | |
5246 | | - | |
| 5259 | + | |
5247 | 5260 | | |
5248 | 5261 | | |
5249 | 5262 | | |
| |||
5354 | 5367 | | |
5355 | 5368 | | |
5356 | 5369 | | |
5357 | | - | |
| 5370 | + | |
5358 | 5371 | | |
5359 | 5372 | | |
5360 | 5373 | | |
| |||
0 commit comments