Skip to content

Commit 7ccf290

Browse files
authored
Revert "Run iOS scenario apps on iPhone 11 and iOS 14 (#30104)" (#30193)
This reverts commit 9b74c21.
1 parent a7a8024 commit 7ccf290

File tree

41 files changed

+118
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+118
-91
lines changed

testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj

Lines changed: 75 additions & 65 deletions
Large diffs are not rendered by default.

testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/xcshareddata/xcschemes/Scenarios.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1300"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenImage.m

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@ - (BOOL)compareGoldenToImage:(UIImage*)image {
3333
os_log_error(OS_LOG_DEFAULT, "GOLDEN DIFF FAILED: image does not exists.");
3434
return NO;
3535
}
36-
37-
// The home bar at the bottom of the screen can be different shades of gray
38-
// depending on how long ago it animated in. This differences causes golden flakes.
39-
// Adjust the height by 25 to crop put the home bar. This value may need to be adjusted
40-
// depending on SDK and device type captured in the goldens.
41-
CGRect imageRect = {CGPointZero, CGSizeMake(image.size.width, image.size.height - 25)};
42-
CGImageRef imageRefA = CGImageCreateWithImageInRect(self.image.CGImage, imageRect);
43-
CGImageRef imageRefB = CGImageCreateWithImageInRect(image.CGImage, imageRect);
36+
CGImageRef imageRefA = [self.image CGImage];
37+
CGImageRef imageRefB = [image CGImage];
4438

4539
NSUInteger widthA = CGImageGetWidth(imageRefA);
4640
NSUInteger heightA = CGImageGetHeight(imageRefA);

testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ - (instancetype)initWithLaunchArg:(NSString*)launchArg {
3939
@"--non-full-screen-flutter-view-platform-view" :
4040
@"non_full_screen_flutter_view_platform_view",
4141
@"--bogus-font-text" : @"bogus_font_text",
42-
@"--spawn-engine-works" : @"spawn_engine_works",
4342
};
4443
});
4544
_identifier = launchArgsMap[launchArg];
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2020 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#import <XCTest/XCTest.h>
6+
7+
NS_ASSUME_NONNULL_BEGIN
8+
9+
@interface SpawnEngineTest : XCTestCase
10+
@property(nonatomic, strong) XCUIApplication* application;
11+
@end
12+
13+
NS_ASSUME_NONNULL_END

testing/scenario_app/ios/Scenarios/ScenariosUITests/SpawnEngineTest.m

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,37 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#import "GoldenPlatformViewTests.h"
6-
7-
@interface SpawnEngineTest : XCTestCase
8-
@end
5+
#import "SpawnEngineTest.h"
6+
#import "GoldenImage.h"
97

108
@implementation SpawnEngineTest
119

12-
- (void)testSpawnEngineWorks {
10+
- (void)setUp {
11+
[super setUp];
1312
self.continueAfterFailure = NO;
1413

15-
XCUIApplication* application = [[XCUIApplication alloc] init];
16-
application.launchArguments = @[ @"--spawn-engine-works", @"--enable-software-rendering" ];
17-
[application launch];
18-
19-
XCUIElement* addTextField = application.textFields[@"ready"];
20-
XCTAssertTrue([addTextField waitForExistenceWithTimeout:30]);
14+
self.application = [[XCUIApplication alloc] init];
15+
self.application.launchArguments = @[ @"--spawn-engine-works", @"--enable-software-rendering" ];
16+
[self.application launch];
17+
}
2118

22-
GoldenTestManager* manager =
23-
[[GoldenTestManager alloc] initWithLaunchArg:@"--spawn-engine-works"];
24-
[manager checkGoldenForTest:self];
19+
- (void)testSpawnEngineWorks {
20+
NSString* prefix = @"golden_spawn_engine_works_";
21+
GoldenImage* golden = [[GoldenImage alloc] initWithGoldenNamePrefix:prefix];
22+
if (!golden.image) {
23+
XCTFail(@"unable to find golden image for: %@", prefix);
24+
}
25+
XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot];
26+
if (![golden compareGoldenToImage:screenshot.image]) {
27+
XCTAttachment* screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image];
28+
screenshotAttachment.name = [golden.goldenName stringByAppendingString:@"_actual"];
29+
screenshotAttachment.lifetime = XCTAttachmentLifetimeKeepAlways;
30+
[self addAttachment:screenshotAttachment];
31+
32+
XCTFail(@"Goldens do not match. Follow the steps in the "
33+
@"README to update golden named %@ if needed.",
34+
golden.goldenName);
35+
}
2536
}
2637

2738
@end
Binary file not shown.
22.7 KB
29.6 KB

0 commit comments

Comments
 (0)