diff --git a/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj b/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj index e7c0d323cf15a..71d8cb57f989d 100644 --- a/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj +++ b/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj @@ -7,8 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 0A02E8F724EFAD27002D54E5 /* BogusFontTextTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A02E8F624EFAD27002D54E5 /* BogusFontTextTest.m */; }; - 0A19E18D2540B6AF00D34505 /* golden_bogus_font_text_iPhone 8_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 0A19E18C2540B6AE00D34505 /* golden_bogus_font_text_iPhone 8_simulator.png */; }; 0A42BFB42447E179007E212E /* TextSemanticsFocusTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A42BFB32447E179007E212E /* TextSemanticsFocusTest.m */; }; 0A57B3BD2323C4BD00DD9521 /* ScreenBeforeFlutter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A57B3BC2323C4BD00DD9521 /* ScreenBeforeFlutter.m */; }; 0A57B3BF2323C74200DD9521 /* FlutterEngine+ScenariosTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A57B3BE2323C74200DD9521 /* FlutterEngine+ScenariosTest.m */; }; @@ -35,6 +33,7 @@ 248D76EF22E388380012F0C1 /* PlatformViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 248D76EE22E388380012F0C1 /* PlatformViewUITests.m */; }; 248FDFC422FE7CD0009CC7CD /* FlutterEngineTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 248FDFC322FE7CD0009CC7CD /* FlutterEngineTest.m */; }; 24D47D1B230C79840069DD5E /* golden_platform_view_D211AP.png in Resources */ = {isa = PBXBuildFile; fileRef = 24D47D1A230C79840069DD5E /* golden_platform_view_D211AP.png */; }; + 24D47D1D230CA2700069DD5E /* golden_platform_view_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 24D47D1C230CA2700069DD5E /* golden_platform_view_iPhone SE_simulator.png */; }; 24F1FB89230B4579005ACE7C /* TextPlatformView.m in Sources */ = {isa = PBXBuildFile; fileRef = 24F1FB87230B4579005ACE7C /* TextPlatformView.m */; }; 3DEF491223C3BE6500184216 /* golden_platform_view_clippath_iPhone 8_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 3DE09E8B23C010BC006C9851 /* golden_platform_view_clippath_iPhone 8_simulator.png */; }; 3DEF491323C3BE6500184216 /* golden_platform_view_cliprect_iPhone 8_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 3DE09E9223C010BD006C9851 /* golden_platform_view_cliprect_iPhone 8_simulator.png */; }; @@ -46,11 +45,17 @@ 3DEF491923C3BE6500184216 /* golden_platform_view_rotate_iPhone 8_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 3DE09E8E23C010BD006C9851 /* golden_platform_view_rotate_iPhone 8_simulator.png */; }; 3DEF491A23C3BE6500184216 /* golden_platform_view_transform_iPhone 8_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 3DE09E9123C010BD006C9851 /* golden_platform_view_transform_iPhone 8_simulator.png */; }; 4F06F1B32473296E000AF246 /* LocalizationInitializationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F06F1B124731F66000AF246 /* LocalizationInitializationTest.m */; }; + 59A97FD8236A49D300B4C066 /* golden_platform_view_multiple_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 59A97FD7236A49D300B4C066 /* golden_platform_view_multiple_iPhone SE_simulator.png */; }; 59A97FDA236B984300B4C066 /* golden_platform_view_multiple_background_foreground_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 59A97FD9236B984300B4C066 /* golden_platform_view_multiple_background_foreground_iPhone SE_simulator.png */; }; 6402EBD124147BDA00987DCB /* UnobstructedPlatformViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6402EBD024147BDA00987DCB /* UnobstructedPlatformViewTests.m */; }; 6816DB9E231750ED00A51400 /* GoldenPlatformViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6816DB9D231750ED00A51400 /* GoldenPlatformViewTests.m */; }; 6816DBA12317573300A51400 /* GoldenImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 6816DBA02317573300A51400 /* GoldenImage.m */; }; - 6816DBA42318358200A51400 /* GoldenTestManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6816DBA32318358200A51400 /* GoldenTestManager.m */; }; + 6816DBA42318358200A51400 /* PlatformViewGoldenTestManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6816DBA32318358200A51400 /* PlatformViewGoldenTestManager.m */; }; + 6816DBAA2318696600A51400 /* golden_platform_view_clippath_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 6816DBA52318696600A51400 /* golden_platform_view_clippath_iPhone SE_simulator.png */; }; + 6816DBAB2318696600A51400 /* golden_platform_view_transform_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 6816DBA62318696600A51400 /* golden_platform_view_transform_iPhone SE_simulator.png */; }; + 6816DBAC2318696600A51400 /* golden_platform_view_opacity_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 6816DBA72318696600A51400 /* golden_platform_view_opacity_iPhone SE_simulator.png */; }; + 6816DBAD2318696600A51400 /* golden_platform_view_cliprect_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 6816DBA82318696600A51400 /* golden_platform_view_cliprect_iPhone SE_simulator.png */; }; + 6816DBAE2318696600A51400 /* golden_platform_view_cliprrect_iPhone SE_simulator.png in Resources */ = {isa = PBXBuildFile; fileRef = 6816DBA92318696600A51400 /* golden_platform_view_cliprrect_iPhone SE_simulator.png */; }; 68A5B63423EB71D300BDBCDB /* PlatformViewGestureRecognizerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 68A5B63323EB71D300BDBCDB /* PlatformViewGestureRecognizerTests.m */; }; /* End PBXBuildFile section */ @@ -109,8 +114,6 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0A02E8F624EFAD27002D54E5 /* BogusFontTextTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BogusFontTextTest.m; sourceTree = ""; }; - 0A19E18C2540B6AE00D34505 /* golden_bogus_font_text_iPhone 8_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_bogus_font_text_iPhone 8_simulator.png"; sourceTree = ""; }; 0A42BFB32447E179007E212E /* TextSemanticsFocusTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TextSemanticsFocusTest.m; sourceTree = ""; }; 0A42BFB52447E19F007E212E /* TextSemanticsFocusTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextSemanticsFocusTest.h; sourceTree = ""; }; 0A57B3BB2323C4BD00DD9521 /* ScreenBeforeFlutter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScreenBeforeFlutter.h; sourceTree = ""; }; @@ -140,6 +143,7 @@ 248D76F022E388380012F0C1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 248FDFC322FE7CD0009CC7CD /* FlutterEngineTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FlutterEngineTest.m; sourceTree = ""; }; 24D47D1A230C79840069DD5E /* golden_platform_view_D211AP.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = golden_platform_view_D211AP.png; sourceTree = ""; }; + 24D47D1C230CA2700069DD5E /* golden_platform_view_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_iPhone SE_simulator.png"; sourceTree = ""; }; 24D47D1E230CA4480069DD5E /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 24F1FB87230B4579005ACE7C /* TextPlatformView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TextPlatformView.m; sourceTree = ""; }; 24F1FB88230B4579005ACE7C /* TextPlatformView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPlatformView.h; sourceTree = ""; }; @@ -153,14 +157,20 @@ 3DE09E9123C010BD006C9851 /* golden_platform_view_transform_iPhone 8_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_transform_iPhone 8_simulator.png"; sourceTree = ""; }; 3DE09E9223C010BD006C9851 /* golden_platform_view_cliprect_iPhone 8_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_cliprect_iPhone 8_simulator.png"; sourceTree = ""; }; 4F06F1B124731F66000AF246 /* LocalizationInitializationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalizationInitializationTest.m; sourceTree = ""; }; + 59A97FD7236A49D300B4C066 /* golden_platform_view_multiple_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_multiple_iPhone SE_simulator.png"; sourceTree = ""; }; 59A97FD9236B984300B4C066 /* golden_platform_view_multiple_background_foreground_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_multiple_background_foreground_iPhone SE_simulator.png"; sourceTree = ""; }; 6402EBD024147BDA00987DCB /* UnobstructedPlatformViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UnobstructedPlatformViewTests.m; sourceTree = ""; }; 6816DB9C231750ED00A51400 /* GoldenPlatformViewTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GoldenPlatformViewTests.h; sourceTree = ""; }; 6816DB9D231750ED00A51400 /* GoldenPlatformViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoldenPlatformViewTests.m; sourceTree = ""; }; 6816DB9F2317573300A51400 /* GoldenImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GoldenImage.h; sourceTree = ""; }; 6816DBA02317573300A51400 /* GoldenImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoldenImage.m; sourceTree = ""; }; - 6816DBA22318358200A51400 /* GoldenTestManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GoldenTestManager.h; sourceTree = ""; }; - 6816DBA32318358200A51400 /* GoldenTestManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoldenTestManager.m; sourceTree = ""; }; + 6816DBA22318358200A51400 /* PlatformViewGoldenTestManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformViewGoldenTestManager.h; sourceTree = ""; }; + 6816DBA32318358200A51400 /* PlatformViewGoldenTestManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PlatformViewGoldenTestManager.m; sourceTree = ""; }; + 6816DBA52318696600A51400 /* golden_platform_view_clippath_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_clippath_iPhone SE_simulator.png"; sourceTree = ""; }; + 6816DBA62318696600A51400 /* golden_platform_view_transform_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_transform_iPhone SE_simulator.png"; sourceTree = ""; }; + 6816DBA72318696600A51400 /* golden_platform_view_opacity_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_opacity_iPhone SE_simulator.png"; sourceTree = ""; }; + 6816DBA82318696600A51400 /* golden_platform_view_cliprect_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_cliprect_iPhone SE_simulator.png"; sourceTree = ""; }; + 6816DBA92318696600A51400 /* golden_platform_view_cliprrect_iPhone SE_simulator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "golden_platform_view_cliprrect_iPhone SE_simulator.png"; sourceTree = ""; }; 68A5B63323EB71D300BDBCDB /* PlatformViewGestureRecognizerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PlatformViewGestureRecognizerTests.m; sourceTree = ""; }; /* End PBXFileReference section */ @@ -249,7 +259,6 @@ children = ( 4F06F1B124731F66000AF246 /* LocalizationInitializationTest.m */, 6402EBD024147BDA00987DCB /* UnobstructedPlatformViewTests.m */, - 0A19E18C2540B6AE00D34505 /* golden_bogus_font_text_iPhone 8_simulator.png */, 0D14A3FD239743190013D873 /* golden_platform_view_rotate_iPhone SE_simulator.png */, 3DE09E8B23C010BC006C9851 /* golden_platform_view_clippath_iPhone 8_simulator.png */, 3DE09E9223C010BD006C9851 /* golden_platform_view_cliprect_iPhone 8_simulator.png */, @@ -261,18 +270,24 @@ 3DE09E8E23C010BD006C9851 /* golden_platform_view_rotate_iPhone 8_simulator.png */, 3DE09E9123C010BD006C9851 /* golden_platform_view_transform_iPhone 8_simulator.png */, 59A97FD9236B984300B4C066 /* golden_platform_view_multiple_background_foreground_iPhone SE_simulator.png */, + 59A97FD7236A49D300B4C066 /* golden_platform_view_multiple_iPhone SE_simulator.png */, 244EA6CF230DBE8900B2D26E /* golden_platform_view_D21AP.png */, + 24D47D1C230CA2700069DD5E /* golden_platform_view_iPhone SE_simulator.png */, 24D47D1A230C79840069DD5E /* golden_platform_view_D211AP.png */, + 6816DBA52318696600A51400 /* golden_platform_view_clippath_iPhone SE_simulator.png */, + 6816DBA82318696600A51400 /* golden_platform_view_cliprect_iPhone SE_simulator.png */, + 6816DBA92318696600A51400 /* golden_platform_view_cliprrect_iPhone SE_simulator.png */, + 6816DBA72318696600A51400 /* golden_platform_view_opacity_iPhone SE_simulator.png */, + 6816DBA62318696600A51400 /* golden_platform_view_transform_iPhone SE_simulator.png */, 248D76EE22E388380012F0C1 /* PlatformViewUITests.m */, - 0A02E8F624EFAD27002D54E5 /* BogusFontTextTest.m */, 248D76F022E388380012F0C1 /* Info.plist */, 24D47D1E230CA4480069DD5E /* README.md */, 6816DB9C231750ED00A51400 /* GoldenPlatformViewTests.h */, 6816DB9D231750ED00A51400 /* GoldenPlatformViewTests.m */, 6816DB9F2317573300A51400 /* GoldenImage.h */, 6816DBA02317573300A51400 /* GoldenImage.m */, - 6816DBA22318358200A51400 /* GoldenTestManager.h */, - 6816DBA32318358200A51400 /* GoldenTestManager.m */, + 6816DBA22318358200A51400 /* PlatformViewGoldenTestManager.h */, + 6816DBA32318358200A51400 /* PlatformViewGoldenTestManager.m */, 68A5B63323EB71D300BDBCDB /* PlatformViewGestureRecognizerTests.m */, 0D8470A2240F0B1F0030B565 /* StatusBarTest.h */, 0D8470A3240F0B1F0030B565 /* StatusBarTest.m */, @@ -416,19 +431,25 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 6816DBAE2318696600A51400 /* golden_platform_view_cliprrect_iPhone SE_simulator.png in Resources */, 3DEF491623C3BE6500184216 /* golden_platform_view_multiple_background_foreground_iPhone 8_simulator.png in Resources */, 3DEF491323C3BE6500184216 /* golden_platform_view_cliprect_iPhone 8_simulator.png in Resources */, 3DEF491523C3BE6500184216 /* golden_platform_view_iPhone 8_simulator.png in Resources */, 0D14A3FE239743190013D873 /* golden_platform_view_rotate_iPhone SE_simulator.png in Resources */, + 6816DBAB2318696600A51400 /* golden_platform_view_transform_iPhone SE_simulator.png in Resources */, 3DEF491823C3BE6500184216 /* golden_platform_view_opacity_iPhone 8_simulator.png in Resources */, - 0A19E18D2540B6AF00D34505 /* golden_bogus_font_text_iPhone 8_simulator.png in Resources */, 3DEF491723C3BE6500184216 /* golden_platform_view_multiple_iPhone 8_simulator.png in Resources */, 3DEF491223C3BE6500184216 /* golden_platform_view_clippath_iPhone 8_simulator.png in Resources */, 3DEF491423C3BE6500184216 /* golden_platform_view_cliprrect_iPhone 8_simulator.png in Resources */, 59A97FDA236B984300B4C066 /* golden_platform_view_multiple_background_foreground_iPhone SE_simulator.png in Resources */, + 6816DBAA2318696600A51400 /* golden_platform_view_clippath_iPhone SE_simulator.png in Resources */, + 6816DBAD2318696600A51400 /* golden_platform_view_cliprect_iPhone SE_simulator.png in Resources */, 3DEF491923C3BE6500184216 /* golden_platform_view_rotate_iPhone 8_simulator.png in Resources */, 24D47D1B230C79840069DD5E /* golden_platform_view_D211AP.png in Resources */, + 59A97FD8236A49D300B4C066 /* golden_platform_view_multiple_iPhone SE_simulator.png in Resources */, + 24D47D1D230CA2700069DD5E /* golden_platform_view_iPhone SE_simulator.png in Resources */, 244EA6D0230DBE8900B2D26E /* golden_platform_view_D21AP.png in Resources */, + 6816DBAC2318696600A51400 /* golden_platform_view_opacity_iPhone SE_simulator.png in Resources */, 3DEF491A23C3BE6500184216 /* golden_platform_view_transform_iPhone 8_simulator.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -466,9 +487,8 @@ 6402EBD124147BDA00987DCB /* UnobstructedPlatformViewTests.m in Sources */, 68A5B63423EB71D300BDBCDB /* PlatformViewGestureRecognizerTests.m in Sources */, 6816DBA12317573300A51400 /* GoldenImage.m in Sources */, - 0A02E8F724EFAD27002D54E5 /* BogusFontTextTest.m in Sources */, 6816DB9E231750ED00A51400 /* GoldenPlatformViewTests.m in Sources */, - 6816DBA42318358200A51400 /* GoldenTestManager.m in Sources */, + 6816DBA42318358200A51400 /* PlatformViewGoldenTestManager.m in Sources */, 248D76EF22E388380012F0C1 /* PlatformViewUITests.m in Sources */, 0D8470A4240F0B1F0030B565 /* StatusBarTest.m in Sources */, 246A6611252E693A00EAB0F3 /* RenderingSelectionTest.m in Sources */, diff --git a/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/xcshareddata/xcschemes/Scenarios.xcscheme b/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/xcshareddata/xcschemes/Scenarios.xcscheme index f1894291285d1..45f9a68a0179b 100644 --- a/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/xcshareddata/xcschemes/Scenarios.xcscheme +++ b/testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/xcshareddata/xcschemes/Scenarios.xcscheme @@ -28,6 +28,15 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" systemAttachmentLifetime = "keepNever"> + + + + - - diff --git a/testing/scenario_app/ios/Scenarios/Scenarios/AppDelegate.m b/testing/scenario_app/ios/Scenarios/Scenarios/AppDelegate.m index 5d1ff4be7d429..96ddd0c734f6d 100644 --- a/testing/scenario_app/ios/Scenarios/Scenarios/AppDelegate.m +++ b/testing/scenario_app/ios/Scenarios/Scenarios/AppDelegate.m @@ -27,7 +27,7 @@ - (BOOL)application:(UIApplication*)application self.window.tintColor = UIColor.systemPinkColor; } NSDictionary* launchArgsMap = @{ - // The golden test args should match `GoldenTestManager`. + // The Platform view golden test args should match `PlatformViewGoldenTestManager`. @"--locale-initialization" : @"locale_initialization", @"--platform-view" : @"platform_view", @"--platform-view-no-overlay-intersection" : @"platform_view_no_overlay_intersection", @@ -52,7 +52,6 @@ - (BOOL)application:(UIApplication*)application @"--tap-status-bar" : @"tap_status_bar", @"--text-semantics-focus" : @"text_semantics_focus", @"--animated-color-square" : @"animated_color_square", - @"--bogus-font-text" : @"bogus_font_text" }; __block NSString* flutterViewControllerTestName = nil; [launchArgsMap diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/BogusFontTextTest.m b/testing/scenario_app/ios/Scenarios/ScenariosUITests/BogusFontTextTest.m deleted file mode 100644 index 4166145d5b306..0000000000000 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/BogusFontTextTest.m +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "GoldenTestManager.h" - -FLUTTER_ASSERT_ARC - -@interface BogusFontTextTest : XCTestCase - -@end - -@implementation BogusFontTextTest - -- (void)testFontRenderingWhenSuppliedWithBogusFont { - self.continueAfterFailure = NO; - - XCUIApplication* application = [[XCUIApplication alloc] init]; - application.launchArguments = @[ @"--bogus-font-text" ]; - [application launch]; - - GoldenTestManager* manager = [[GoldenTestManager alloc] initWithLaunchArg:@"--bogus-font-text"]; - [manager checkGoldenForTest:self]; -} - -@end diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.h b/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.h index fd1b05ef0b009..3e4d0add04137 100644 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.h +++ b/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.h @@ -3,7 +3,7 @@ // found in the LICENSE file. #import -#import "GoldenTestManager.h" +#import "PlatformViewGoldenTestManager.h" NS_ASSUME_NONNULL_BEGIN @@ -12,19 +12,20 @@ NS_ASSUME_NONNULL_BEGIN // A new PlatformView golden tests can subclass this and override the `-initiWithInvocation:` // method, which then retun the `-initWithManager:invocation:` // -// Then in any test method, call `checkPlatformViewGolden` to perform the golden test. +// Then in any test method, call `checkGolden` to perform the golden test. // // This base class doesn't run any test case on its own. @interface GoldenPlatformViewTests : XCTestCase @property(nonatomic, strong) XCUIApplication* application; -// Initialize with a `GoldenTestManager`. -- (instancetype)initWithManager:(GoldenTestManager*)manager invocation:(NSInvocation*)invocation; +// Initialize with a `PlatformViewGoldenTestManager`. +- (instancetype)initWithManager:(PlatformViewGoldenTestManager*)manager + invocation:(NSInvocation*)invocation; // Take a sceenshot of the test app and check it has the same pixels with goldenImage inside the -// `GoldenTestManager`. -- (void)checkPlatformViewGolden; +// `PlatformViewGoldenTestManager`. +- (void)checkGolden; @end diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.m b/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.m index 7e4bb368fc6eb..29f1a472aa094 100644 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.m +++ b/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.m @@ -5,7 +5,8 @@ #import "GoldenPlatformViewTests.h" #include -#import "GoldenTestManager.h" + +#import "PlatformViewGoldenTestManager.h" static const NSInteger kSecondsToWaitForPlatformView = 30; @@ -13,13 +14,14 @@ @interface GoldenPlatformViewTests () @property(nonatomic, copy) NSString* goldenName; -@property(nonatomic, strong) GoldenTestManager* manager; +@property(nonatomic, strong) PlatformViewGoldenTestManager* manager; @end @implementation GoldenPlatformViewTests -- (instancetype)initWithManager:(GoldenTestManager*)manager invocation:(NSInvocation*)invocation { +- (instancetype)initWithManager:(PlatformViewGoldenTestManager*)manager + invocation:(NSInvocation*)invocation { self = [super initWithInvocation:invocation]; _manager = manager; return self; @@ -35,7 +37,7 @@ - (void)setUp { } // Note: don't prefix with "test" or GoldenPlatformViewTests will run instead of the subclasses. -- (void)checkPlatformViewGolden { +- (void)checkGolden { XCUIElement* element = self.application.textViews.firstMatch; BOOL exists = [element waitForExistenceWithTimeout:kSecondsToWaitForPlatformView]; if (!exists) { @@ -45,6 +47,29 @@ - (void)checkPlatformViewGolden { @(kSecondsToWaitForPlatformView)); } - [self.manager checkGoldenForTest:self]; + GoldenImage* golden = self.manager.goldenImage; + + XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot]; + if (!golden.image) { + XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot]; + attachment.name = @"new_golden"; + attachment.lifetime = XCTAttachmentLifetimeKeepAlways; + [self addAttachment:attachment]; + XCTFail(@"This test will fail - no golden named %@ found. Follow the steps in the " + @"README to add a new golden.", + golden.goldenName); + } + + if (![golden compareGoldenToImage:screenshot.image]) { + XCTAttachment* screenshotAttachment; + screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image]; + screenshotAttachment.name = golden.goldenName; + screenshotAttachment.lifetime = XCTAttachmentLifetimeKeepAlways; + [self addAttachment:screenshotAttachment]; + + XCTFail(@"Goldens to not match. Follow the steps in the " + @"README to update golden named %@ if needed.", + golden.goldenName); + } } @end diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.h b/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.h similarity index 78% rename from testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.h rename to testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.h index 4bb0b275a77e9..733ea8839f11b 100644 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.h +++ b/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.h @@ -3,7 +3,7 @@ // found in the LICENSE file. #import -#import + #import "GoldenImage.h" NS_ASSUME_NONNULL_BEGIN @@ -14,7 +14,7 @@ extern NSDictionary* launchArgsMap; // // It creates the correct `identifer` based on the `launchArg`. // It also generates the correct GoldenImage based on the `identifier`. -@interface GoldenTestManager : NSObject +@interface PlatformViewGoldenTestManager : NSObject @property(readonly, strong, nonatomic) GoldenImage* goldenImage; @property(readonly, copy, nonatomic) NSString* identifier; @@ -25,10 +25,6 @@ extern NSDictionary* launchArgsMap; // Crahes if the launchArg is not mapped in `Appdelegate.launchArgsMap`. - (instancetype)initWithLaunchArg:(NSString*)launchArg; -// Take a sceenshot of the test app and check it has the same pixels with -// goldenImage inside the `GoldenTestManager`. -- (void)checkGoldenForTest:(XCTestCase*)test; - @end NS_ASSUME_NONNULL_END diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.m b/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.m similarity index 50% rename from testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.m rename to testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.m index dcb82342f710b..230fe5c89e238 100644 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.m +++ b/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.m @@ -2,16 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#import "GoldenTestManager.h" +#import "PlatformViewGoldenTestManager.h" + #import -@interface GoldenTestManager () +@interface PlatformViewGoldenTestManager () @property(readwrite, strong, nonatomic) GoldenImage* goldenImage; @end -@implementation GoldenTestManager +@implementation PlatformViewGoldenTestManager NSDictionary* launchArgsMap; @@ -33,7 +34,6 @@ - (instancetype)initWithLaunchArg:(NSString*)launchArg { @"--platform-view-transform" : @"platform_view_transform", @"--platform-view-opacity" : @"platform_view_opacity", @"--platform-view-rotate" : @"platform_view_rotate", - @"--bogus-font-text" : @"bogus_font_text", }; }); _identifier = launchArgsMap[launchArg]; @@ -44,32 +44,4 @@ - (instancetype)initWithLaunchArg:(NSString*)launchArg { return self; } -- (void)checkGoldenForTest:(XCTestCase*)test { - XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot]; - if (!_goldenImage.image) { - XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot]; - attachment.name = [_goldenImage.goldenName stringByAppendingString:@"_new"]; - attachment.lifetime = XCTAttachmentLifetimeKeepAlways; - [test addAttachment:attachment]; - // Instead of XCTFail because that definition changed between Xcode 11 and 12 whereas this impl - // is stable. - _XCTPrimitiveFail(test, - @"This test will fail - no golden named %@ found. " - @"Follow the steps in the README to add a new golden.", - _goldenImage.goldenName); - } - - if (![_goldenImage compareGoldenToImage:screenshot.image]) { - XCTAttachment* screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image]; - screenshotAttachment.name = [_goldenImage.goldenName stringByAppendingString:@"_actual"]; - screenshotAttachment.lifetime = XCTAttachmentLifetimeKeepAlways; - [test addAttachment:screenshotAttachment]; - - _XCTPrimitiveFail(test, - @"Goldens do not match. Follow the steps in the " - @"README to update golden named %@ if needed.", - _goldenImage.goldenName); - } -} - @end diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewUITests.m b/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewUITests.m index a078c46aa86f1..1d23e3a064378 100644 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewUITests.m +++ b/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewUITests.m @@ -11,12 +11,13 @@ @interface PlatformViewUITests : GoldenPlatformViewTests @implementation PlatformViewUITests - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -28,13 +29,13 @@ @interface MultiplePlatformViewsTest : GoldenPlatformViewTests @implementation MultiplePlatformViewsTest - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-multiple"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-multiple"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -46,7 +47,7 @@ @interface MultiplePlatformViewsBackgroundForegroundTest : GoldenPlatformViewTes @implementation MultiplePlatformViewsBackgroundForegroundTest - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = [[GoldenTestManager alloc] + PlatformViewGoldenTestManager* manager = [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-multiple-background-foreground"]; return [super initWithManager:manager invocation:invocation]; } @@ -54,7 +55,7 @@ - (instancetype)initWithInvocation:(NSInvocation*)invocation { - (void)testPlatformView { [[XCUIDevice sharedDevice] pressButton:XCUIDeviceButtonHome]; [self.application activate]; - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -67,13 +68,13 @@ @interface PlatformViewMutationClipRectTests : GoldenPlatformViewTests @implementation PlatformViewMutationClipRectTests - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-cliprect"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-cliprect"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -85,13 +86,13 @@ @interface PlatformViewMutationClipRRectTests : GoldenPlatformViewTests @implementation PlatformViewMutationClipRRectTests - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-cliprrect"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-cliprrect"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -103,13 +104,13 @@ @interface PlatformViewMutationClipPathTests : GoldenPlatformViewTests @implementation PlatformViewMutationClipPathTests - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-clippath"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-clippath"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -121,13 +122,13 @@ @interface PlatformViewMutationTransformTests : GoldenPlatformViewTests @implementation PlatformViewMutationTransformTests - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-transform"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-transform"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -139,13 +140,13 @@ @interface PlatformViewMutationOpacityTests : GoldenPlatformViewTests @implementation PlatformViewMutationOpacityTests - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-opacity"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-opacity"]; return [super initWithManager:manager invocation:invocation]; } - (void)testPlatformView { - [self checkPlatformViewGolden]; + [self checkGolden]; } @end @@ -155,8 +156,8 @@ @interface PlatformViewRotation : GoldenPlatformViewTests @implementation PlatformViewRotation - (instancetype)initWithInvocation:(NSInvocation*)invocation { - GoldenTestManager* manager = - [[GoldenTestManager alloc] initWithLaunchArg:@"--platform-view-rotate"]; + PlatformViewGoldenTestManager* manager = + [[PlatformViewGoldenTestManager alloc] initWithLaunchArg:@"--platform-view-rotate"]; return [super initWithManager:manager invocation:invocation]; } @@ -167,6 +168,6 @@ - (void)tearDown { - (void)testPlatformView { XCUIDevice.sharedDevice.orientation = UIDeviceOrientationLandscapeLeft; - [self checkPlatformViewGolden]; + [self checkGolden]; } @end diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/README.md b/testing/scenario_app/ios/Scenarios/ScenariosUITests/README.md index 652fbed14aa35..70e34f3e3d600 100644 --- a/testing/scenario_app/ios/Scenarios/ScenariosUITests/README.md +++ b/testing/scenario_app/ios/Scenarios/ScenariosUITests/README.md @@ -1,16 +1,16 @@ -# Golden UI Tests +# PlatformView UI Tests -This folder contains golden image tests. It renders UI (for instance, a platform -view) and does a screen shot comparison against a known good configuration. +This folder contains a test for platform views. It renders a platform view +and does a screen shot comparison against a known good configuration. -The screen shots are named `golden_[scenario name]_[MODEL]`, with `_simulator` +The screen shots are named `golden_platform_view_MODEL`, with `_simulator` appended for simulators. The model numbers for physical devices correspond to the `hw.model` sys call, and will represent the model numbers. Simulator names are taken from the environment. New devices require running the test on the device, gathering the attachment -from the test result and verifying it manually. Then adding an appropriately -named file to this folder. +and verifying it manually, and then adding an appropriately named file to +this folder. If the test is attempted on a new device, the log will contain a message indicating the file name it expected to find. The test will continue and fail, diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_bogus_font_text_iPhone 8_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_bogus_font_text_iPhone 8_simulator.png deleted file mode 100644 index ee124e0089ca8..0000000000000 Binary files a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_bogus_font_text_iPhone 8_simulator.png and /dev/null differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_clippath_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_clippath_iPhone SE_simulator.png new file mode 100644 index 0000000000000..8e776f220e849 Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_clippath_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone SE_simulator.png new file mode 100644 index 0000000000000..9049412903215 Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprect_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone SE_simulator.png new file mode 100644 index 0000000000000..94667b9a8254d Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_cliprrect_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone SE_simulator.png new file mode 100644 index 0000000000000..1f9ee8937d927 Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone SE_simulator.png new file mode 100644 index 0000000000000..f3176650205d4 Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_multiple_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone SE_simulator.png new file mode 100644 index 0000000000000..32e0a179a5c6c Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_opacity_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_transform_iPhone SE_simulator.png b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_transform_iPhone SE_simulator.png new file mode 100644 index 0000000000000..678c7fd6bc7bb Binary files /dev/null and b/testing/scenario_app/ios/Scenarios/ScenariosUITests/golden_platform_view_transform_iPhone SE_simulator.png differ diff --git a/testing/scenario_app/lib/src/bogus_font_text.dart b/testing/scenario_app/lib/src/bogus_font_text.dart deleted file mode 100644 index e3cbbae08def5..0000000000000 --- a/testing/scenario_app/lib/src/bogus_font_text.dart +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// @dart = 2.6 -import 'dart:ui'; - -import 'scenario.dart'; - -/// Tries to draw some text in a bogus font. Should end up drawing in the -/// system default font. -class BogusFontText extends Scenario { - /// Creates the BogusFontText scenario. - /// - /// The [dispatcher] parameter must not be null. - BogusFontText(PlatformDispatcher dispatcher) - : assert(dispatcher != null), - super(dispatcher); - - // Semi-arbitrary. - double _screenWidth = 700; - - @override - void onBeginFrame(Duration duration) { - final SceneBuilder builder = SceneBuilder(); - final PictureRecorder recorder = PictureRecorder(); - final Canvas canvas = Canvas(recorder); - - final ParagraphBuilder paragraphBuilder = - ParagraphBuilder(ParagraphStyle(fontFamily: "some font that doesn't exist")) - ..pushStyle(TextStyle(fontSize: 80)) - ..addText('One more thing...') - ..pop(); - final Paragraph paragraph = paragraphBuilder.build(); - - paragraph.layout(ParagraphConstraints(width: _screenWidth)); - - canvas.drawParagraph(paragraph, const Offset(50, 80)); - final Picture picture = recorder.endRecording(); - - builder.addPicture( - Offset.zero, - picture, - willChangeHint: true, - ); - final Scene scene = builder.build(); - window.render(scene); - scene.dispose(); - } - - @override - void onDrawFrame() { - // Just draw once since the content never changes. - } -} diff --git a/testing/scenario_app/lib/src/scenarios.dart b/testing/scenario_app/lib/src/scenarios.dart index 572eaa2ad7d49..7431752d4bbe1 100644 --- a/testing/scenario_app/lib/src/scenarios.dart +++ b/testing/scenario_app/lib/src/scenarios.dart @@ -6,7 +6,6 @@ import 'dart:ui'; import 'animated_color_square.dart'; -import 'bogus_font_text.dart'; import 'initial_route_reply.dart'; import 'locale_initialization.dart'; import 'platform_view.dart'; @@ -44,7 +43,6 @@ Map _scenarios = { 'tap_status_bar': () => TouchesScenario(PlatformDispatcher.instance), 'text_semantics_focus': () => SendTextFocusSemantics(PlatformDispatcher.instance), 'initial_route_reply': () => InitialRouteReply(PlatformDispatcher.instance), - 'bogus_font_text': () => BogusFontText(PlatformDispatcher.instance), }; Map _currentScenarioParams = {};