Reland "Add some abstractions around NSWorkspace methods for shortcuts."
This is a reland of commit 8bf2ea19 Not re-inventing the wheel and instead using existing test helpers in the unit tests seems to fix test failures on vmware backed 10.15 bots (presumably because of better color space handling and accounting for inaccuracies that can result from color space conversions). Original change's description: > Add some abstractions around NSWorkspace methods for shortcuts. > > setIcon:forFile: is not re-entrant and thus multiple calls to it need > to be sequenced. To ensure this is done, this adds a wrapper around the > method that does all the calls to this method on the same > SequencedTaskRunner. Existing usage of this method in web apps code > is migrated to use the new wrapper. > > setDefaultApplicationAtURL: toOpenFileAtURL: only exists in macOS 12 > and newer. To also support older OS versions, this CL adds a wrapper > that uses this method on macOS 12, and hardcodes the implementation of > this method for older OS versions. Unit tests verify that this does > indeed work even on older OS versions. > > Bug: 333024272 > Change-Id: I64574153e86d6471ed5c94710885c312f4c6356b > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459962 > Reviewed-by:Avi Drissman <avi@chromium.org> > Reviewed-by:
Daniel Murphy <dmurph@chromium.org> > Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1288864} Bug: 333024272 Change-Id: I3d5d734d69b5c43ba4edf9f3fa0010245602d7fc Cq-Include-Trybots: luci.chromium.try:mac_chromium_10.15_rel_ng,mac_chromium_11.0_rel_ng Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5465490 Commit-Queue: Avi Drissman <avi@chromium.org> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org> Auto-Submit: Marijn Kruisselbrink <mek@chromium.org> Reviewed-by:
Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1289606}
Loading
Please register or sign in to comment