-
Notifications
You must be signed in to change notification settings - Fork 6k
Properly calculate alwaysUse24HourFormat on MacOS #53795
Properly calculate alwaysUse24HourFormat on MacOS #53795
Conversation
c347a3a to
b29181f
Compare
b29181f to
99313d2
Compare
f1ccbb5 to
f16f37e
Compare
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
knopp
left a comment
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. This seems like a straightforward refactor. Not sure if this needs a test since it only moves things from iOS to darwin embedder. Also I'm not sure how to test this given that the behavior depends on system settings. @cbracken, any ideas?
In the usual case, we'd say extract out a thin utility class that wraps the system setting and then write a test of the usage site against a mock. You could write a test against the existing usage that just tests that the value set in the |
cbracken
left a comment
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.
This isn't just a refactoring though; the purpose of this PR is to change the behavior of the macOS embedding. That's a behavioral change that should not regress, and thus should be tested. (In this case I would suggest a test that |
|
From PR triage: It looks like this PR is waiting for a test to be added, correct? |
Yes, I will get to that over the weekend. |
shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/ios/framework/Source/FlutterViewControllerTest.mm
Outdated
Show resolved
Hide resolved
shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm
Outdated
Show resolved
Hide resolved
cbracken
left a comment
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.
Overall looks good, just a few nits and suggestions.
|
I think that the PR is ready for merge. @cbracken please merge/add "autosubmit" [if you agree]. |
|
Note that flutter/flutter#32006 is best left [re-]opened, and updated to refer only to |
|
Thanks for the fix, @kpsroka! Merged! |
…152703) flutter/engine@230879c...17e3c7d 2024-08-01 [email protected] Properly calculate alwaysUse24HourFormat on MacOS (flutter/engine#53795) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#152703) flutter/engine@230879c...17e3c7d 2024-08-01 [email protected] Properly calculate alwaysUse24HourFormat on MacOS (flutter/engine#53795) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#152703) flutter/engine@230879c...17e3c7d 2024-08-01 [email protected] Properly calculate alwaysUse24HourFormat on MacOS (flutter/engine#53795) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Moves the implementation if isAlwaysUse24HourFormat from iOS's FlutterViewController internals to common utility, and makes use of it on MacOS in order to return correct value of
alwaysUse24HourFormat.This PR partially resolves #32006.
Note that on iOS 16+ and MacOS 13+, there is a new API for obtaining this information: https://developer.apple.com/documentation/foundation/locale/components/3952289-hourcycle. However, to keep things simpler, I wanted to not include changes to the logic.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.