-
Notifications
You must be signed in to change notification settings - Fork 6k
Add a golden scenario test for fallback font rendering on iOS take 2 #22033
Conversation
I think the previous pre-submit failures were due to our LUCI bots re-running the golden generation on iOS 13 whereas I made it on iOS 14. Might have to download an Xcode 11 copy again. |
XCTAttachment* screenshotAttachment; | ||
screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these two can be in a single line
testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenTestManager.m
Outdated
Show resolved
Hide resolved
if (![_goldenImage compareGoldenToImage:screenshot.image]) { | ||
XCTAttachment* screenshotAttachment; | ||
screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image]; | ||
screenshotAttachment.name = _goldenImage.goldenName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe format this as make it _goldenImage.goldenName + "_current"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
called it "actual" to match testing terminology
XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot]; | ||
if (!_goldenImage.image) { | ||
XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot]; | ||
attachment.name = @"new_golden"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similar: maybe format this as make it _goldenImage.goldenName + "_new"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, good idea
BlueprintName = "Scenarios" | ||
ReferencedContainer = "container:Scenarios.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I stopped using a build var in the argument scheme somewhere. This whole thing is just for facilitating local test runs inside Xcode for debug and doesn't affect anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how but I weaksauced the last PR which wasn't passing because the golden screenshot I saved was in the wrong dpi.
XCUIScreenshot* screenshot = [[XCUIScreen mainScreen] screenshot]; | ||
if (!_goldenImage.image) { | ||
XCTAttachment* attachment = [XCTAttachment attachmentWithScreenshot:screenshot]; | ||
attachment.name = @"new_golden"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, good idea
if (![_goldenImage compareGoldenToImage:screenshot.image]) { | ||
XCTAttachment* screenshotAttachment; | ||
screenshotAttachment = [XCTAttachment attachmentWithImage:screenshot.image]; | ||
screenshotAttachment.name = _goldenImage.goldenName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
called it "actual" to match testing terminology
oops, forgot the tree is closed |
Tests are crapping out probably due to some transient nnbd issue. Rebasing |
2080e89
to
dd9c63b
Compare
There are conflicts to the auto-merge bot won't land this. @xster can you please rebase? The tree is open now. |
dd9c63b
to
f18ef54
Compare
* 000bf4b Roll Skia from 2d2f82c00aeb to 5c7bb326a7b3 (33 revisions) (flutter/engine#22059) * ae92dbf Roll Fuchsia Linux SDK from lPMs_KwnU... to gqS_DIjN4... (flutter/engine#22057) * 92cd74e Roll Fuchsia Mac SDK from pZ9FgVZTK... to WLxBkBnZa... (flutter/engine#22055) * e51c710 Roll Dart SDK from a3d902d8598e to 9f907e198970 (2 revisions) (flutter/engine#22058) * 326b202 Reland fuchsia external view embedder will be shared with platform view (flutter/engine#22008) * a9a9a2f Roll Skia from 5c7bb326a7b3 to 65674e4c2e56 (3 revisions) (flutter/engine#22060) * 1233fe4 Revert "Revert "Explicitly make the X connection for EGL. (#21831)" (#21851)" (flutter/engine#21871) * aed8e01 Fixes Edge trigger route change announcement (flutter/engine#21975) * 6bc70e4 Reland: Migration to PlatformDispatcher and multi-window (flutter/engine#21932) * 5ca5e26 Add FlEventChannel (flutter/engine#21316) * 77b0052 Roll Skia from 65674e4c2e56 to 01b05e5b830b (3 revisions) (flutter/engine#22062) * 3d27fd5 Support loading assets from Android dynamic feature modules (flutter/engine#21504) * 742dfbe support uri intent launcher in android (flutter/engine#21275) * cde1e3f Auto detect mode to determine which rendering backend to use. (flutter/engine#21852) * 329ccf7 Roll Skia from 01b05e5b830b to 53281c712159 (1 revision) (flutter/engine#22065) * cde78c1 Add a golden scenario test for fallback font rendering on iOS take 2 (flutter/engine#22033) * 4f4599b Roll Dart SDK from 9f907e198970 to 37ccceacad41 (3 revisions) (flutter/engine#22069) * f0b10c5 [web] Prevent using DOM nodes for canvas with large number of draws (flutter/engine#22064) * a86ba57 Roll Fuchsia Mac SDK from WLxBkBnZa... to zDfaxkqlv... (flutter/engine#22073) * 645198a Roll Fuchsia Linux SDK from gqS_DIjN4... to vuKxZmSVj... (flutter/engine#22074) * 0b26570 Revert dart rolls (flutter/engine#22078)
… take 2 (flutter#22033)" (flutter#22095) This reverts commit cde78c1.
Didn't have time to revise #20687 and merge it before. This would have actually helped catch flutter/flutter#68399 too I believe.
Original PR relates to flutter/flutter#60013. If user specifies a font that doesn't exist, it should properly fallback to the SF font and render it correctly.
Also removing the duplicate iPhone SE images as discussed with @blasten and refactor a modular golden test part out of the platform view stuff.
Also addresses flutter/flutter#68625.