Skip to content

Commit 8c9ad11

Browse files
author
Chris Yang
authored
[ci][image_picker][webviews_flutter] enable Xcode 12 (flutter#3461)
1 parent 647f698 commit 8c9ad11

File tree

7 files changed

+69
-20
lines changed

7 files changed

+69
-20
lines changed

.cirrus.yml

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,12 @@ task:
134134
- xvfb-run ./script/incremental_build.sh drive-examples --linux
135135

136136
task:
137+
# Xcode 12 task
137138
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
138139
only_if: $CIRRUS_TAG == ''
139140
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
140141
osx_instance:
141-
image: catalina-xcode-11.3.1-flutter
142+
image: big-sur-xcode-12.3
142143
upgrade_script:
143144
- sudo gem install cocoapods
144145
- flutter channel stable
@@ -149,7 +150,7 @@ task:
149150
activate_script: pub global activate flutter_plugin_tools
150151
create_simulator_script:
151152
- xcrun simctl list
152-
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
153+
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
153154
matrix:
154155
- name: build_all_plugins_ipa
155156
env:
@@ -162,17 +163,6 @@ task:
162163
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
163164
- flutter channel $CHANNEL
164165
- ./script/build_all_plugins_app.sh ios --no-codesign
165-
- name: lint_darwin_plugins
166-
env:
167-
matrix:
168-
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2"
169-
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2"
170-
script:
171-
# TODO(jmagman): Lint macOS podspecs but skip any that fail library validation.
172-
- find . -name "*.podspec" | xargs grep -l "osx" | xargs rm
173-
# Skip the dummy podspecs used to placate the tool.
174-
- find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm
175-
- ./script/incremental_build.sh podspecs
176166
- name: build-ipas+drive-examples
177167
env:
178168
PATH: $PATH:/usr/local/bin
@@ -194,13 +184,46 @@ task:
194184
- flutter upgrade
195185
- ./script/incremental_build.sh build-examples --ipa
196186
- ./script/incremental_build.sh drive-examples
197-
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS
187+
- ./script/incremental_build.sh xctest --target RunnerUITests --skip $PLUGINS_TO_SKIP_XCTESTS --ios-destination "platform=iOS Simulator,name=iPhone 11,OS=14.3"
188+
198189
task:
190+
# Xcode 11 task
191+
# TODO(cyanglaz): merge Xcode 11 task to Xcode 12 task when all the matrix can be run in Xcode 12.
199192
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
200193
only_if: $CIRRUS_TAG == ''
201194
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
202195
osx_instance:
203196
image: catalina-xcode-11.3.1-flutter
197+
upgrade_script:
198+
- sudo gem install cocoapods
199+
- flutter channel stable
200+
- flutter upgrade
201+
- flutter channel master
202+
- flutter upgrade
203+
- git fetch origin master
204+
activate_script: pub global activate flutter_plugin_tools
205+
create_simulator_script:
206+
- xcrun simctl list
207+
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
208+
matrix:
209+
- name: lint_darwin_plugins
210+
env:
211+
matrix:
212+
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2"
213+
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2"
214+
script:
215+
# TODO(jmagman): Lint macOS podspecs but skip any that fail library validation.
216+
- find . -name "*.podspec" | xargs grep -l "osx" | xargs rm
217+
# Skip the dummy podspecs used to placate the tool.
218+
- find . -name "*_web*.podspec" -o -name "*_mac*.podspec" | xargs rm
219+
- ./script/incremental_build.sh podspecs
220+
221+
task:
222+
# don't run on release tags since it creates O(n^2) tasks where n is the number of plugins
223+
only_if: $CIRRUS_TAG == ''
224+
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
225+
osx_instance:
226+
image: big-sur-xcode-12.3
204227
setup_script:
205228
- flutter config --enable-macos-desktop
206229
upgrade_script:

packages/image_picker/image_picker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.7+22
2+
3+
* iOS: update XCUITests to separate each test session.
4+
15
## 0.6.7+21
26

37
* Update the example app: remove the deprecated `RaisedButton` and `FlatButton` widgets.

packages/image_picker/image_picker/example/ios/RunnerUITests/ImagePickerFromGalleryUITests.m

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ @interface ImagePickerFromGalleryUITests : XCTestCase
1616
@implementation ImagePickerFromGalleryUITests
1717

1818
- (void)setUp {
19+
[super setUp];
1920
// Delete the app if already exists, to test permission popups
2021

2122
self.continueAfterFailure = NO;
@@ -31,7 +32,7 @@ - (void)setUp {
3132
if (![allPhotoPermission waitForExistenceWithTimeout:
3233
kElementWaitingTime]) {
3334
os_log_error(OS_LOG_DEFAULT, "%@",
34-
self.app.debugDescription);
35+
weakSelf.app.debugDescription);
3536
XCTFail(@"Failed due to not able to find "
3637
@"allPhotoPermission button with %@ seconds",
3738
@(kElementWaitingTime));
@@ -42,7 +43,7 @@ - (void)setUp {
4243
if (![ok waitForExistenceWithTimeout:
4344
kElementWaitingTime]) {
4445
os_log_error(OS_LOG_DEFAULT, "%@",
45-
self.app.debugDescription);
46+
weakSelf.app.debugDescription);
4647
XCTFail(@"Failed due to not able to find ok button "
4748
@"with %@ seconds",
4849
@(kElementWaitingTime));
@@ -53,11 +54,19 @@ - (void)setUp {
5354
}];
5455
}
5556

57+
- (void)tearDown {
58+
[super tearDown];
59+
[self.app terminate];
60+
}
61+
5662
- (void)testPickingFromGallery {
57-
[self launchPickerAndCancel];
5863
[self launchPickerAndPick];
5964
}
6065

66+
- (void)testCancel {
67+
[self launchPickerAndCancel];
68+
}
69+
6170
- (void)launchPickerAndCancel {
6271
// Find and tap on the pick from gallery button.
6372
NSPredicate* predicateToFindImageFromGalleryButton =
@@ -160,6 +169,10 @@ - (void)launchPickerAndPick {
160169
XCTAssertTrue(pickButton.exists);
161170
[pickButton tap];
162171

172+
// There is a known bug where the permission popups interruption won't get fired until a tap
173+
// happened in the app. We expect a permission popup so we do a tap here.
174+
[self.app tap];
175+
163176
// Find an image and tap on it. (IOS 14 UI, images are showing directly)
164177
XCUIElement* aImage;
165178
if (@available(iOS 14, *)) {
@@ -177,6 +190,7 @@ - (void)launchPickerAndPick {
177190
identifier:@"PhotosGridView"]
178191
.cells.firstMatch;
179192
}
193+
os_log_error(OS_LOG_DEFAULT, "description before picking image %@", self.app.debugDescription);
180194
if (![aImage waitForExistenceWithTimeout:kElementWaitingTime]) {
181195
os_log_error(OS_LOG_DEFAULT, "%@", self.app.debugDescription);
182196
XCTFail(@"Failed due to not able to find an image with %@ seconds", @(kElementWaitingTime));

packages/image_picker/image_picker/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: image_picker
22
description: Flutter plugin for selecting images from the Android and iOS image
33
library, and taking new pictures with the camera.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker/image_picker
5-
version: 0.6.7+21
5+
version: 0.6.7+22
66

77
flutter:
88
plugin:

packages/webview_flutter/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.0-nullsafety.4
2+
3+
* Update integration test to workaround an iOS 14 issue with `evaluateJavascript`.
4+
15
## 2.0.0-nullsafety.3
26

37
* Fix `onWebResourceError` on iOS.

packages/webview_flutter/example/integration_test/webview_flutter_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ void main() {
144144
await pageLoaded.future;
145145

146146
expect(messagesReceived, isEmpty);
147-
await controller.evaluateJavascript('Echo.postMessage("hello");');
147+
// Append a return value "1" in the end will prevent an iOS platform exception.
148+
// See: https://github.com/flutter/flutter/issues/66318#issuecomment-701105380
149+
// TODO(cyanglaz): remove the workaround "1" in the end when the below issue is fixed.
150+
// https://github.com/flutter/flutter/issues/66318
151+
await controller.evaluateJavascript('Echo.postMessage("hello");1;');
148152
expect(messagesReceived, equals(<String>['hello']));
149153
});
150154

packages/webview_flutter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: webview_flutter
22
description: A Flutter plugin that provides a WebView widget on Android and iOS.
3-
version: 2.0.0-nullsafety.3
3+
version: 2.0.0-nullsafety.4
44
homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter
55

66
environment:

0 commit comments

Comments
 (0)