| Summary: | [macOS] Tests that show system menu popups may fail when run concurrently | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Wenson Hsieh <wenson_hsieh> | ||||||
| Component: | Tools / Tests | Assignee: | Wenson Hsieh <wenson_hsieh> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | darin, dino, hi, megan_gardner, thorton, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Wenson Hsieh
2020-07-03 20:16:28 PDT
Created attachment 403505 [details]
For EWS
Comment on attachment 403505 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=403505&action=review > Tools/WebKitTestRunner/mac/TestControllerMac.mm:134 > + static NeverDestroyed<InstanceMethodSwizzler> cancelTrackingSwizzler { NSMenu.class, @selector(cancelTracking), reinterpret_cast<IMP>(swizzledCancelTracking) }; > + static NeverDestroyed<ClassMethodSwizzler> menuPopUpSwizzler { NSMenu.class, @selector(popUpContextMenu:withEvent:forView:), reinterpret_cast<IMP>(swizzledPopUpContextMenu) }; > + static NeverDestroyed<InstanceMethodSwizzler> carbonMenuPopUpSwizzler { Do these really need NeverDestroyed? Maybe they would with ARC, but I don’t see why they need it without ARC. Keep in mind that NeverDestroyed does not make something stay alive for the duration of execution: being a global makes that happen. NeverDestroyed simply prevents the destructor from being called, which is useful for such objects if they have destructors. Comment on attachment 403505 [details] For EWS View in context: https://bugs.webkit.org/attachment.cgi?id=403505&action=review >> Tools/WebKitTestRunner/mac/TestControllerMac.mm:134 >> + static NeverDestroyed<InstanceMethodSwizzler> carbonMenuPopUpSwizzler { > > Do these really need NeverDestroyed? Maybe they would with ARC, but I don’t see why they need it without ARC. Keep in mind that NeverDestroyed does not make something stay alive for the duration of execution: being a global makes that happen. NeverDestroyed simply prevents the destructor from being called, which is useful for such objects if they have destructors. That's a good point — the `NeverDestroyed<>` doesn't add anything here. I changed these into just `static InstanceMethodSwizzler …` and `static ClassMethodSwizzler …`. Created attachment 403507 [details]
Remove NeverDestroyed.
Committed r263929: <https://trac.webkit.org/changeset/263929> All reviewed patches have been landed. Closing bug and clearing flags on attachment 403507 [details]. |