Skip to content

feat(maps3d): add maps3d-robolectric-testing module - #30

Open
dkhawk wants to merge 2 commits into
mainfrom
feat/maps3d-robolectric-testing
Open

dkhawk wants to merge 2 commits into
mainfrom
feat/maps3d-robolectric-testing

Conversation

@dkhawk

@dkhawk dkhawk commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Adds a dedicated :maps3d-robolectric-testing module (com.google.maps.android:maps3d-testing-robolectric) providing headless JVM Robolectric testing support for the Google Maps 3D SDK for Android (play-services-maps3d), decoupled from the 2D :robolectric-testing module.

What's included

  • Maps3DRobolectricTestRunner: Registers all 8 Maps 3D shadows via Robolectric's Injector and binds Maps3DClassInstrumentor to avoid splitting Map3DView's private 4-arg constructor (which otherwise triggers an ASM Label.resolve crash due to R8 outlining a theme branch across FrameLayout.<init>).
  • Robolectric Shadows: ShadowMap3DView, ShadowGoogleMap3D, ShadowMarker, ShadowPolyline, ShadowPolygon, ShadowModel, ShadowPopover, and ShadowUiControlSettings — tracking lifecycle, camera/fly animations, ID-keyed overlay upserts, removals, UI control placements, and click simulation.
  • KTX & Java Harness: findMap3DView() / requireMap3DView(), createTestMap3DView(), getMap3DBlocking(), createTestMap3D(), withTestMap3D(), Kotlin .shadow extensions, and Maps3DShadows.shadowOf(...) for Java callers.
  • Google Truth Subject: Maps3DTruth.assertThat(googleMap3D) / GoogleMap3DSubject (hasMapMode, hasCameraCenterNear, hasCameraAltitudeWithin, hasMarker/hasPolyline/hasPolygon/hasModel, hasModelNear, hasNoOverlays, etc.).
  • Build & API wiring: Java 11 bytecode target, compileOnly dependencies, committed maps3d-robolectric-testing.api, Dokka aggregation, Maven publishing (maps3d-testing-robolectric, with optional -PpublishVersion override for local Maven testing).

Verification

  • ./gradlew :maps3d-robolectric-testing:testDebugUnitTest :maps3d-robolectric-testing:lint spotlessApply apiCheck :docs:dokkaGenerate
  • Published to mavenLocal() with -PpublishVersion=1.0.0-rc03 and verified against googlemaps-samples/android-maps3d-samples (kotlin-app and java-app Robolectric tests).

@github-actions

Copy link
Copy Markdown

Coverage (unit tests)

No unit baseline recorded in coverage/history.csv yet, so this run only reports absolute numbers.

Module Line % Change Branch % Change
golden-testing 90.42% new 58.00% new
maps3d-robolectric-testing 68.99% new 51.00% new
robolectric-testing 84.25% new 51.87% new
visual-testing 63.58% new 35.16% new
TOTAL 80.09% new 47.43% new

Line and branch coverage from unit test reports. History is recorded in coverage/history.csv after each merge to main.

@dkhawk
dkhawk marked this pull request as ready for review November 20, 2026 17:51
@dkhawk
dkhawk requested review from LoyalAbbas and kikoso November 20, 2026 17:51
@snippet-bot

snippet-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

Here is the summary of possible violations 😱

Details

There is a possible violation for not having product prefix.

The end of the violation section. All the stuff below is FYI purposes only.


Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant