Skip to content

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

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)。Android でも同じことが起きないかを、実物の地図で確かめる回帰テストを足す。コードの変更はなく、テストだけ。

Android は影響なし

setMapDesignType → setStyle → setupStyle が、スタイルを読み込むたびに groundImageController.reapplyStyle() で全部の地表画像を作り直している。iOS はここでハンドルを捨てずに、状態の変わらない画像を飛ばしていた。

テスト

MapLibreGroundImageStyleChangeTest(androidTest、新規): 実物の MapView にローカルの空スタイルを 2 つ用意し、state.mapDesignType で切り替える。

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

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

確認

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

Instrumented: a real MapView loads two local styles through
setMapDesignType, and the ground image is checked in the new style
(unchanged image, same design set again, removal after the change).
Android is not affected by the iOS bug (ios-for-maplibre#12):
setupStyle calls groundImageController.reapplyStyle() on every load.
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 46c73d6 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