Skip to content

[google_maps_flutter] Migrate iOS unit tests to Swift#12232

Merged
auto-submit[bot] merged 14 commits into
flutter:mainfrom
stuartmorgan-g:maps-ios-xctest-swift
Jul 18, 2026
Merged

[google_maps_flutter] Migrate iOS unit tests to Swift#12232
auto-submit[bot] merged 14 commits into
flutter:mainfrom
stuartmorgan-g:maps-ios-xctest-swift

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Migrates all of the unit tests to Swift (UI tests were already converted in a previous PR). The process was:

  • Have Gemini convert all the files
  • Manually do a side-by-side comparison to make sure things matched (a few things needed to be fixed up at this step, but mostly it did a good job)
  • Once everything looked good, have Gemini do some minor Swift improvements (mostly ended up being adoption of XCTUnwrap instead of using let/guards that mimicked the Obj-C code)
  • Have Gemini do a conversion from XCTest to Swift Testing. This was almost entirely mechanical; there was just one usage of expectations that was rewritten following a pattern we have used in other plugins

This does introduce a bridging header in the unit test runner because Swift needs them to access the contents of the _Test headers; once the implementation moves to Swift, we'll be able to pull that back out.

There are two small non-test changes here:

  • Two headers that were missing NS_ASSUME_NONNULL_BEGIN/_END were fixed. They were written as if the macros were there, and we just never noticed that they weren't. I found it because the converted tests were doing force-unwraps on some constructors that I knew shouldn't be nullable.
  • FGMGetValueOrNilFromDict was removed because it was dead code. I noticed that we had tests for it and realized I missed removing it when I finished the Pigeon migration a while back.

Since neither of these have any runtime impact, I am skipping versioning.

Part of flutter/flutter#119108
Part of flutter/flutter#180787

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

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.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@stuartmorgan-g stuartmorgan-g added override: allow breaking change Override the check preventing breaking changes to platform interfaces override: no changelog needed Override the check requiring CHANGELOG updates for most changes labels Jul 17, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 17, 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 migrates the existing Objective-C unit tests for the Google Maps Flutter plugin to Swift, utilizing the Swift Testing framework. The changes include updating the Xcode project configuration to support Swift, adding the necessary bridging headers, and refactoring the test suites for Circle, ClusterManagers, ConversionUtils, ExtractIconFromData, GoogleMaps, GroundOverlay, Marker, Polygon, Polyline, and TileOverlay controllers. The review feedback identified an opportunity to simplify the asynchronous test implementation in the TileProviderController tests by capturing the continuation directly within the block to avoid potential retain cycles.

@stuartmorgan-g stuartmorgan-g added override: no versioning needed Override the check requiring version bumps for most changes and removed override: allow breaking change Override the check preventing breaking changes to platform interfaces labels Jul 17, 2026
#expect(resultImage?.size.height == 1.0)
}

@Test func extractIconFromDataAssetAutoWithScale() {

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.

uber nit: this test and the one above can be parameterized it seems? Or maybe in a separate PR for clean diffs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I figured given the scale of this PR I would just stick to conversions, and we could adopt new feature improvements in later PRs.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 18, 2026
@auto-submit
auto-submit Bot merged commit 161b24d into flutter:main Jul 18, 2026
13 checks passed
pull Bot pushed a commit to Klomgor/flutter that referenced this pull request Jul 20, 2026
…r#189727)

flutter/packages@4fdc766...611899b

2026-07-20 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump org.json:json from 20260522 to 20260719 in
/packages/in_app_purchase/in_app_purchase_android/example/android/app
(flutter/packages#12247)
2026-07-20 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.maps.android:android-maps-utils from 4.0.0
to 5.0.0 in
/packages/google_maps_flutter/google_maps_flutter_android/example/android/app
(flutter/packages#12245)
2026-07-18 [email protected] Roll Flutter from
fc1ad95 to 8005793 (40 revisions) (flutter/packages#12241)
2026-07-18 [email protected] [google_maps_flutter] Migrate iOS
unit tests to Swift (flutter/packages#12232)
2026-07-17 [email protected]
[camera_android_camerax] Migrate skills validation test to new
dart_skills_lint API (flutter/packages#12226)

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-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
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
@this-sunil

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD override: no changelog needed Override the check requiring CHANGELOG updates for most changes override: no versioning needed Override the check requiring version bumps for most changes p: google_maps_flutter platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants