| Summary: | NowPlayingInfoArtwork operator== returns wrong value | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Jean-Yves Avenard [:jya] <jean-yves.avenard> | ||||||||
| Component: | Media | Assignee: | Jean-Yves Avenard [:jya] <jean-yves.avenard> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | annulen, eric.carlson, ews-watchlist, glenn, gyuyoung.kim, jer.noble, philipj, ryuan.choi, sergio, webkit-bug-importer, youennf | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Jean-Yves Avenard [:jya]
2021-03-24 22:32:17 PDT
Created attachment 424224 [details]
Patch
Comment on attachment 424224 [details]
Patch
I would be tempted to change the patch so that we define == operator.
And implement != operator based on ==
Comment on attachment 424224 [details]
Patch
r=me
Rethinking about it, we should probably add a test for it. The principle is to write a unit test (or API test). You can for instance look at examples in Tools/TestWebKitAPI/Tests/WebCore/IntRectTests.cpp. Created attachment 424292 [details]
Patch
Created attachment 424293 [details]
Patch
Comment on attachment 424293 [details] Patch Landing the changes now. Some additional comments below. View in context: https://bugs.webkit.org/attachment.cgi?id=424293&action=review > Source/WebCore/platform/audio/NowPlayingInfo.h:42 > bool operator==(const NowPlayingInfoArtwork& other) const Given this is a struct, we could make it a free function, which is usually preferred when possible. > Tools/TestWebKitAPI/Tests/WebCore/NowPlayingInfoTests.cpp:32 > +static void testEmptyArtwork(const WebCore::NowPlayingInfoArtwork& artwork) Not really needed, it could be inline in the TEST itself. Committed r275091: <https://commits.webkit.org/r275091> All reviewed patches have been landed. Closing bug and clearing flags on attachment 424293 [details]. |