Skip to content

Google maps plugin on Android fails to center initial location when surface size is changed. #106750

@bparrishMines

Description

@bparrishMines

Steps to Reproduce

Running the following test fails when using Flutter master: https://github.com/flutter/plugins/blob/main/packages/google_maps_flutter/google_maps_flutter/example/integration_test/google_maps_test.dart#L428

The test runs successfully when the following line is removed https://github.com/flutter/plugins/blob/main/packages/google_maps_flutter/google_maps_flutter/example/integration_test/google_maps_test.dart#L428

await tester.binding.setSurfaceSize(const Size(800.0, 600.0));
Logs
06-27 08:46:06.083: I/flutter(22833): The following TestFailure was thrown running a test:
06-27 08:46:06.083: I/flutter(22833): Expected: <1100>
06-27 08:46:06.083: I/flutter(22833):   Actual: <540>
06-27 08:46:06.083: I/flutter(22833): When the exception was thrown, this was the stack:
06-27 08:46:06.083: I/flutter(22833): #4      main.<anonymous closure> (file:///tmp/cirrus-ci-build/packages/google_maps_flutter/google_maps_flutter/example/integration_test/google_maps_test.dart:464:7)
06-27 08:46:06.083: I/flutter(22833): <asynchronous suspension>
06-27 08:46:06.083: I/flutter(22833): #5      testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:171:15)
06-27 08:46:06.083: I/flutter(22833): <asynchronous suspension>
06-27 08:46:06.083: I/flutter(22833): #6      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:841:5)
06-27 08:46:06.083: I/flutter(22833): <asynchronous suspension>
06-27 08:46:06.083: I/flutter(22833): This was caught by the test expectation on the following line:
06-27 08:46:06.083: I/flutter(22833):   file:///tmp/cirrus-ci-build/packages/google_maps_flutter/google_maps_flutter/example/integration_test/google_maps_test.dart line 464
06-27 08:46:06.083: I/flutter(22833): The test description was:
06-27 08:46:06.083: I/flutter(22833):   testInitialCenterLocationAtCenter
06-27 08:46:06.084: I/flutter(22833): 

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listp: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions