Skip to content

iOS: Eliminate use of IOSContextNoop in platform view tests (reland) - #190509

Merged
cbracken merged 1 commit into
flutter:masterfrom
cbracken:cleanup-eliminate-ioscontextnoop-in-tests
Aug 4, 2026
Merged

cbracken merged 1 commit into
flutter:masterfrom
cbracken:cleanup-eliminate-ioscontextnoop-in-tests

Conversation

@cbracken

@cbracken cbracken commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

This relands #190419, which I reverted in #190501 because it broke the tree due to a (non-merge) conflict with #190416.

#190419 added a local FakeIOSContext whose GetBackend() override returned flutter::IOSRenderingBackend::kImpeller.

#190416 landed immediately before it and removed the IOSContext::GetBackend() virtual and the IOSRenderingBackend enum, so the two changes had no merge conflicts but FakeIOSContext no longer compiled once both were in the tree.

This reland is identical other than deleting the GetBackend() override. FakeIOSContext still inherits the null Impeller/Aiks contexts from the base class and returns no external texture, matching the behaviour the tests rely on.

Original change:

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.

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: #190041
Issue: #112232

Pre-launch Checklist

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. 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.

This relands flutter#190419, which I reverted in flutter#190501 because it broke the
tree due to a (non-merge) conflict with flutter#190416.

flutter#190419 added a local `FakeIOSContext` whose `GetBackend()` override
returned `flutter::IOSRenderingBackend::kImpeller`.

flutter#190416 landed immediately before it and removed the
`IOSContext::GetBackend()` virtual and the `IOSRenderingBackend` enum,
so the two changes had no merge conflicts but `FakeIOSContext` no longer
compiled once both were in the tree.

This reland is identical other than deleting the `GetBackend()`
override. `FakeIOSContext` still inherits the null Impeller/Aiks
contexts from the base class and returns no external texture, matching
the behaviour the tests rely on.

Original change:

`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.

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
@cbracken
cbracken requested a review from gaaclarke August 4, 2026 06:06
@cbracken
cbracken requested a review from a team as a code owner August 4, 2026 06:06
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 4, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Aug 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the use of flutter::IOSContextNoop with a locally defined FakeIOSContext in FlutterPlatformViewsTest.mm. The new fake context inherits from flutter::IOSContext and overrides CreateExternalTexture to return nullptr. Multiple test cases are updated to instantiate FakeIOSContext instead of flutter::IOSContextNoop. There are no review comments, and I have no feedback to provide.

@cbracken
cbracken added this pull request to the merge queue Aug 4, 2026
Merged via the queue into flutter:master with commit 497ab92 Aug 4, 2026
22 checks passed
@cbracken
cbracken deleted the cleanup-eliminate-ioscontextnoop-in-tests branch August 4, 2026 21:52
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 10, 2026
…12420)

Manual roll requested by [email protected]

flutter/flutter@b766512...27b0988

2026-08-05 [email protected] reland(tool): remove redundant --enable-experiment=record-use flag (flutter/flutter#190591)
2026-08-05 [email protected] Windows: Propagate enabled accessibility state (flutter/flutter#190507)
2026-08-05 [email protected] Roll Fuchsia Test Scripts from ltbuIH9Z3T_yOuigu... to vcANVO8VIDQHasH1X... (flutter/flutter#190589)
2026-08-05 [email protected] Document frozen embedder API structs (flutter/flutter#186842)
2026-08-05 [email protected] Document super call order for State.didChangeDependencies (flutter/flutter#185945)
2026-08-05 [email protected] Move examples of `flutter/widgets` widgets out from `flutter/material` (flutter/flutter#189532)
2026-08-05 [email protected] [web] Use thread local strike caches in skwasm (flutter/flutter#190048)
2026-08-05 [email protected] doc: fix typo in see also section for PrimaryScrollController.maybeOf (flutter/flutter#190386)
2026-08-05 [email protected] Migrate the shell unit tests from legacy Dart native functions to FFI (flutter/flutter#190473)
2026-08-05 [email protected] render proxy box now defaults baseline calculation to null (flutter/flutter#190269)
2026-08-05 [email protected] Update Widgets Localizations from Translation Console (flutter/flutter#190503)
2026-08-04 [email protected] Revert: fix(tool): remove redundant --enable-experiment=record-use flag (flutter/flutter#190583)
2026-08-04 [email protected] Roll Fuchsia Test Scripts from 1frGe_KltAJKkeyPg... to ltbuIH9Z3T_yOuigu... (flutter/flutter#190561)
2026-08-04 [email protected] iOS,macOS: add tsan and ubsan support for Swift (flutter/flutter#190497)
2026-08-04 [email protected] fix: update on_message_ to nullptr after window destroy so that dart gets destroy message  (flutter/flutter#185807)
2026-08-04 [email protected] [flutter_tools] Gracefully handle locked Windows files during clean (flutter/flutter#190095)
2026-08-04 [email protected] iOS,macOS: make Logger thread-safe, conform to Sendable (flutter/flutter#190488)
2026-08-04 [email protected] iOS: Eliminate use of IOSContextNoop in platform view tests (reland) (flutter/flutter#190509)
2026-08-04 [email protected] fix(tool): remove redundant --enable-experiment=record-use flag (flutter/flutter#190475)
2026-08-04 [email protected] android_hardware_smoke_test: Detect blank image failures or EGL initialization warnings and retry (flutter/flutter#190110)
2026-08-04 [email protected] Bumps text gamma on windows to match skia. (flutter/flutter#190477)
2026-08-04 [email protected] Roll Skia from 48b58ee222f1 to a8583a0a2c11 (2 revisions) (flutter/flutter#190537)
2026-08-04 [email protected] [tool][web] Intercept dart2wasm errors & append JS migration footers (flutter/flutter#190476)
2026-08-04 [email protected] [record_use] Migrate IconTreeShaker to `package:record_use` (flutter/flutter#190225)
2026-08-04 [email protected] Handle unexpected exceptions during Azure metadata detection (flutter/flutter#189457)
2026-08-04 [email protected] Fix merge conflict from flutter/flutter#190369 (flutter/flutter#190544)
2026-08-04 [email protected] Prepare device support symbols (flutter/flutter#190369)
2026-08-04 [email protected] Roll Packages from ac87e65 to 3498b9d (1 revision) (flutter/flutter#190532)
2026-08-04 [email protected] Roll Skia from a08d918ebd6a to 48b58ee222f1 (11 revisions) (flutter/flutter#190527)

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] 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants