Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 65 additions & 75 deletions testing/scenario_app/ios/Scenarios/Scenarios.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ - (BOOL)compareGoldenToImage:(UIImage*)image {
}

NS_INLINE NSString* _platformName() {
NSString* systemVersion = UIDevice.currentDevice.systemVersion;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change--golden_bogus_font_text_iPhone 8_13.0_simulator.png and golden_bogus_font_text_iPhone 8_15.0_simulator.png can both be checked in.

NSString* simulatorName =
[[NSProcessInfo processInfo].environment objectForKey:@"SIMULATOR_DEVICE_NAME"];
if (simulatorName) {
return [NSString stringWithFormat:@"%@_simulator", simulatorName];
return [NSString stringWithFormat:@"%@_%@_simulator", simulatorName, systemVersion];
}

size_t size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ - (instancetype)initWithLaunchArg:(NSString*)launchArg {
@"--non-full-screen-flutter-view-platform-view" :
@"non_full_screen_flutter_view_platform_view",
@"--bogus-font-text" : @"bogus_font_text",
@"--spawn-engine-works" : @"spawn_engine_works",
};
});
_identifier = launchArgsMap[launchArg];
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "SpawnEngineTest.h"
#import "GoldenImage.h"
#import "GoldenPlatformViewTests.h"

@interface SpawnEngineTest : XCTestCase
@end

@implementation SpawnEngineTest

- (void)setUp {
[super setUp];
- (void)testSpawnEngineWorks {
self.continueAfterFailure = NO;

self.application = [[XCUIApplication alloc] init];
self.application.launchArguments = @[ @"--spawn-engine-works", @"--enable-software-rendering" ];
[self.application launch];
}
XCUIApplication* application = [[XCUIApplication alloc] init];
application.launchArguments = @[ @"--spawn-engine-works", @"--enable-software-rendering" ];
[application launch];

- (void)testSpawnEngineWorks {
NSString* prefix = @"golden_spawn_engine_works_";
GoldenImage* golden = [[GoldenImage alloc] initWithGoldenNamePrefix:prefix];
if (!golden.image) {
XCTFail(@"unable to find golden image for: %@", prefix);
}
XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot];
if (![golden compareGoldenToImage:screenshot.image]) {
XCTAttachment* screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image];
screenshotAttachment.name = [golden.goldenName stringByAppendingString:@"_actual"];
screenshotAttachment.lifetime = XCTAttachmentLifetimeKeepAlways;
[self addAttachment:screenshotAttachment];

XCTFail(@"Goldens do not match. Follow the steps in the "
@"README to update golden named %@ if needed.",
golden.goldenName);
}
XCUIElement* addTextField = application.textFields[@"ready"];
XCTAssertTrue([addTextField waitForExistenceWithTimeout:30]);

GoldenTestManager* manager =
[[GoldenTestManager alloc] initWithLaunchArg:@"--spawn-engine-works"];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this test use GoldenTestManager so it isn't doing one-off screenshots.

[manager checkGoldenForTest:self];
}

@end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ - (void)testPointerHover {
XCTAssertNotEqual(lastHoverSequenceNumber, -1,
@"PointerChange.hover event did not occur for a hover");
NSString* removeMessage = [NSString
stringWithFormat:@"%d,PointerChange.remove,device=0,buttons=0", lastHoverSequenceNumber + 1];
stringWithFormat:@"%ld,PointerChange.remove,device=0,buttons=0", lastHoverSequenceNumber + 1];
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix a warning.

XCTAssertTrue([app.textFields[removeMessage] waitForExistenceWithTimeout:1],
@"PointerChange.remove event did not occur for a hover");
}
Expand Down