Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add one more test
  • Loading branch information
Emmanuel Garcia committed May 24, 2022
commit 52b890eb79a12a30efa87685a28ed7b46e1fec3b
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,23 @@ public void InvalidateMapAfterMarkersUpdate() throws InterruptedException {
argument.getValue().onMapLoaded();
verify(mapView).invalidate();
}

@Test
public void UpdateMarkersAfterControllerIsDestroyed() throws InterruptedException {
googleMapController.onMapReady(mockGoogleMap);
MethodChannel.Result result = mock(MethodChannel.Result.class);
googleMapController.onMethodCall(
new MethodCall("markers#update", new HashMap<String, Object>()), result);

ArgumentCaptor<GoogleMap.OnMapLoadedCallback> argument =
ArgumentCaptor.forClass(GoogleMap.OnMapLoadedCallback.class);
verify(mockGoogleMap).setOnMapLoadedCallback(argument.capture());

MapView mapView = mock(MapView.class);
googleMapController.setView(mapView);
googleMapController.onDestroy(activity);

argument.getValue().onMapLoaded();
verify(mapView, never()).invalidate();
}
}