From cb6cd0a3e8bd490c7df67faa7a6801b859321a5b Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Fri, 3 Dec 2021 10:49:02 -0800 Subject: [PATCH] Update IosUnitTests to use iPhone 11 simulator (flutter/engine#30090) --- .../ios/framework/Source/FlutterViewControllerTest.mm | 5 +++-- engine/src/flutter/testing/ios/IosUnitTests/README.md | 6 +++--- engine/src/flutter/testing/run_tests.py | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm index bcd3ce1e0a..4f7aa78907 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm @@ -357,9 +357,10 @@ typedef enum UIAccessibilityContrast : NSInteger { nibName:nil bundle:nil]; mockEngine.viewController = viewController; - [viewController updateViewportMetrics]; flutter::ViewportMetrics viewportMetrics; - OCMVerify([mockEngine updateViewportMetrics:viewportMetrics]); + OCMExpect([mockEngine updateViewportMetrics:viewportMetrics]).ignoringNonObjectArgs(); + [viewController updateViewportMetrics]; + OCMVerifyAll(mockEngine); } - (void)testViewDidLoadDoesntInvokeEngineWhenNotTheViewController { diff --git a/engine/src/flutter/testing/ios/IosUnitTests/README.md b/engine/src/flutter/testing/ios/IosUnitTests/README.md index 1055e8ceef..557fb6e29b 100644 --- a/engine/src/flutter/testing/ios/IosUnitTests/README.md +++ b/engine/src/flutter/testing/ios/IosUnitTests/README.md @@ -15,9 +15,9 @@ After the `ios_test_flutter` target is built you can also run the tests inside of Xcode with `testing/ios/IosUnitTests/IosUnitTests.xcodeproj`. When you load the test project [IosUnitTests.xcodeproj](IosUnitTests.xcodeproj) -into XCode after running `run_tests.py`, only a few basic tests will appear -initially. You have to run the test suite once in XCode for the rest to appear. -Select "iPhone 8" as the device, and press `command-u` to start all the tests +into Xcode after running `run_tests.py`, only a few basic tests will appear +initially. You have to run the test suite once in Xcode for the rest to appear. +Select "iPhone 11" as the device, and press `command-u` to start all the tests running. Once the tests are done running, the tests that ran will appear in the sidebar, and you can pick the specific one you want to debug/run. diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 15940a9d85..edac4df1f7 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -387,7 +387,7 @@ def RunObjcTests(ios_variant='ios_debug_sim_unopt', test_filter=None): 'xcodebuild ' '-sdk iphonesimulator ' '-scheme IosUnitTests ' - "-destination platform='iOS Simulator,name=iPhone 8' " + "-destination platform='iOS Simulator,name=iPhone 11' " 'test ' 'FLUTTER_ENGINE=' + ios_variant ]