[google_maps_flutter] Migrate iOS unit tests to Swift#12232
Conversation
There was a problem hiding this comment.
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.
| #expect(resultImage?.size.height == 1.0) | ||
| } | ||
|
|
||
| @Test func extractIconFromDataAssetAutoWithScale() { |
There was a problem hiding this comment.
uber nit: this test and the one above can be parameterized it seems? Or maybe in a separate PR for clean diffs?
There was a problem hiding this comment.
I figured given the scale of this PR I would just stick to conversions, and we could adopt new feature improvements in later PRs.
…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
Migrates all of the unit tests to Swift (UI tests were already converted in a previous PR). The process was:
This does introduce a bridging header in the unit test runner because Swift needs them to access the contents of the
_Testheaders; once the implementation moves to Swift, we'll be able to pull that back out.There are two small non-test changes here:
NS_ASSUME_NONNULL_BEGIN/_ENDwere 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.FGMGetValueOrNilFromDictwas 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
[shared_preferences]///).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-assistbot 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
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