Skip to content

Commit 5053074

Browse files
ditmannploi
authored andcommitted
[ci] Fix some web-platform_tests. (flutter#3285)
[ci] Fix some web-platform_tests.
1 parent d71d8ae commit 5053074

File tree

4 files changed

+47
-25
lines changed

4 files changed

+47
-25
lines changed

.cirrus.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,7 @@ task:
318318
build_script:
319319
- ./script/tool_runner.sh build-examples --web
320320
drive_script:
321-
# TODO(stuartmorgan): Figure out why url_launcher_web is failing on stable and re-enable it:
322-
# https://github.com/flutter/flutter/issues/121161
323-
- if [[ "$CHANNEL" == "master" ]]; then
324-
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml
325-
- else
326-
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml,url_launcher_web
327-
- fi
321+
- ./script/tool_runner.sh drive-examples --web --exclude=script/configs/exclude_integration_web.yaml
328322
- name: web_benchmarks_test
329323
env:
330324
matrix:

packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ import 'package:mockito/mockito.dart';
1616

1717
import 'google_maps_controller_test.mocks.dart';
1818

19-
// This value is used when comparing long~num, like
20-
// LatLng values.
21-
const double _acceptableDelta = 0.0000000001;
22-
2319
@GenerateMocks(<Type>[], customMocks: <MockSpec<dynamic>>[
2420
MockSpec<CirclesController>(onMissingStub: OnMissingStub.returnDefault),
2521
MockSpec<PolygonsController>(onMissingStub: OnMissingStub.returnDefault),
@@ -697,20 +693,7 @@ void main() {
697693
});
698694

699695
group('moveCamera', () {
700-
testWidgets('newLatLngZoom', (WidgetTester tester) async {
701-
await controller.moveCamera(
702-
CameraUpdate.newLatLngZoom(
703-
const LatLng(19, 26),
704-
12,
705-
),
706-
);
707-
708-
final gmaps.LatLng gmCenter = map.center!;
709-
710-
expect(map.zoom, 12);
711-
expect(gmCenter.lat, closeTo(19, _acceptableDelta));
712-
expect(gmCenter.lng, closeTo(26, _acceptableDelta));
713-
});
696+
// Tested in projection_test.dart
714697
});
715698

716699
group('map.projection methods', () {

packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/projection_test.dart

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,35 @@ void main() {
4545
};
4646
});
4747

48+
group('moveCamera', () {
49+
testWidgets('center can be moved with newLatLngZoom',
50+
(WidgetTester tester) async {
51+
await pumpCenteredMap(
52+
tester,
53+
initialCamera: initialCamera,
54+
size: size,
55+
onMapCreated: onMapCreated,
56+
);
57+
58+
final GoogleMapController controller = await controllerCompleter.future;
59+
60+
await controller.moveCamera(
61+
CameraUpdate.newLatLngZoom(
62+
const LatLng(19, 26),
63+
12,
64+
),
65+
);
66+
67+
final LatLng coords = await controller.getLatLng(
68+
ScreenCoordinate(x: size.width ~/ 2, y: size.height ~/ 2),
69+
);
70+
71+
expect(await controller.getZoomLevel(), 12);
72+
expect(coords.latitude, closeTo(19, _acceptableLatLngDelta));
73+
expect(coords.longitude, closeTo(26, _acceptableLatLngDelta));
74+
});
75+
});
76+
4877
group('getScreenCoordinate', () {
4978
testWidgets('target of map is in center of widget',
5079
(WidgetTester tester) async {

packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ void main() {
7171
expect(anchor.getAttribute('href'),
7272
urlStrategy?.prepareExternalUrl(uri3.toString()));
7373
expect(anchor.getAttribute('target'), '_self');
74+
75+
// Needed when testing on on Chrome98 headless in CI.
76+
// See https://github.com/flutter/flutter/issues/121161
77+
await tester.pumpAndSettle();
7478
});
7579

7680
testWidgets('sizes itself correctly', (WidgetTester tester) async {
@@ -103,6 +107,10 @@ void main() {
103107
// `ConstrainedBox` widget.
104108
expect(containerSize.width, 100.0);
105109
expect(containerSize.height, 100.0);
110+
111+
// Needed when testing on on Chrome98 headless in CI.
112+
// See https://github.com/flutter/flutter/issues/121161
113+
await tester.pumpAndSettle();
106114
});
107115

108116
// See: https://github.com/flutter/plugins/pull/3522#discussion_r574703724
@@ -122,6 +130,10 @@ void main() {
122130

123131
final html.Element anchor = _findSingleAnchor();
124132
expect(anchor.hasAttribute('href'), false);
133+
134+
// Needed when testing on on Chrome98 headless in CI.
135+
// See https://github.com/flutter/flutter/issues/121161
136+
await tester.pumpAndSettle();
125137
});
126138

127139
testWidgets('can be created and disposed', (WidgetTester tester) async {
@@ -152,6 +164,10 @@ void main() {
152164
800,
153165
maxScrolls: 1000,
154166
);
167+
168+
// Needed when testing on on Chrome98 headless in CI.
169+
// See https://github.com/flutter/flutter/issues/121161
170+
await tester.pumpAndSettle();
155171
});
156172
});
157173
}

0 commit comments

Comments
 (0)