WPT details: A test suite is currently impossible due to the lack of an API to query favicons. It is tested for Chromium using the internals API.
The link element’s “media” attribute will be honored for link[rel="icon"] so that web developers can define multiple equally appropriate icons based on a media query (dark and light modes for instance). The last one that matches will be picked. Browsers don’t currently honor the media attribute for link[rel="icon"] even though the HTML specification says they should.
This is a known and acknowledged bug in Chrome.
Samples: https://media-link.glitch.me/