Skip to content

Test that a ground image survives a map design change - #15

Merged
wf9a5m75 merged 2 commits into
developfrom
test/ground-image-style-change
Oct 27, 2026
Merged

wf9a5m75 merged 2 commits into
developfrom
test/ground-image-style-change

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

何のための PR か

iOS で「地表画像を表示したまま地図デザインを変えると画像が消える」不具合があった(MapConductor/ios-for-maplibre#12、Mapbox は MapConductor/ios-for-mapbox#10)。Android でも同じことが起きないかを、実物の地図で確かめる回帰テストを足す。コードの変更はなく、テストだけ。

Android は影響なし

setMapDesignType → loadStyle の後、スタイル読み込みの購読(subscribeStyleLoaded)が groundImageController.reapplyStyle() で全部の地表画像を作り直している。

テスト

MapboxGroundImageStyleChangeTest(androidTest、新規): 実物の MapView に、ソースを持たないローカルのスタイル文書を 2 つ読み込ませ、state.mapDesignType で切り替える。ソースが無いので何も取りに行かず、本物のアクセストークンは要らない(sdkInitialize でダミーを渡している)。

  • anUnchangedGroundImageIsInTheNewStyle — 状態を変えずにデザインだけ替えても、新しいスタイルにソースとレイヤがある
  • theSameDesignSetAgainKeepsTheImage — 同じデザインをもう一度設定しても画像が残る
  • aGroundImageRemovedAfterTheChangeLeavesTheNewStyle — 替えた後に消すと新しいスタイルから消える

build.gradle.kts に androidTest 用の依存(runner、compose ui-test-junit4、debug の ui-test-manifest)を追加。

確認

  • エミュレータ(API 34)で connectedDebugAndroidTest: 3 件すべて成功
  • テストが不具合を捕まえることの確認: スタイル読み込みの購読の中の groundImageController.reapplyStyle() を一時的に外すと 3 件すべて失敗する(元に戻してある)

Instrumented: a real MapView loads two local style documents through
setMapDesignType, and the ground image is checked in the new style
(unchanged image, same design set again, removal after the change).
The styles have no sources, so a placeholder access token is enough.
Android is not affected by the iOS bug (ios-for-maplibre#12): the
style-loaded subscription calls groundImageController.reapplyStyle().
Removing that call makes all three fail.
CI builds the repository on its own, against gradle/libs.versions.toml
here, which had no androidx-runner or ui-test entries; they resolved only
in the android-sdk monorepo's catalog the tests were first built with.
Compose test artifacts follow this repo's composeLibs (1.12.1).
@wf9a5m75
wf9a5m75 merged commit 00033a0 into develop Oct 27, 2026
2 checks passed
@wf9a5m75
wf9a5m75 deleted the test/ground-image-style-change branch October 27, 2026 02:21
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