New issue
Advanced search Search tips

Issue 923502 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

MimeUtilTest.GetPreferredExtensionForMimeType test fails on Windows

Project Member Reported by bingler@google.com, Jan 18 (4 days ago)

Issue description

Chrome Version: 73.0.3677.0 (Developer Build) (64-bit) bb3ba4e8a35f83f2d22af762a9fc5aac1c5ab129-refs/heads/master@{#624257}
OS: Win10 (64-bit) and Win7 (64-bit) tested

What steps will reproduce the problem?
(1) Build net_unittests
(2) Run net_unittests
(3) See MimeUtilTest.GetPreferredExtensionForMimeType fail

What is the expected result?
MimeUtilTest.GetPreferredExtensionForMimeType passes

What happens instead?
It fails:
../../net/base/mime_util_unittest.cc(81): error: Expected equality of these values:
  test.expected_extension
    Which is: L"webm"
  extension
    Which is: L"weba"

 

Comment 1 by mmenke@chromium.org, Jan 18 (4 days ago)

GetPreferredExtensionForMimeType() first calls GetPlatformPreferredExtensionForMimeType(), which calls into the platform to get the extension it prefers.  So presumably recent versions of Windows 10 associate weba with "audio/webm".

So we either need to modify the test to allow both, or disable the test / remove that test case.  I suppose we could also either deprioritize the platform's preferred extensions for each MIME type, or remove the call into platform code entirely, though I'm not sufficiently familiar with the motivation to use a platform API here (on OSX and Windows, at least), to make that call.

[asanka]:  Thoughts?

Comment 2 by asanka@chromium.org, Today (15 hours ago)

Components: Internals>Network
Thanks for catching this. I'd be okay with removing the test case if we are seeing a variance in platform behavior here.

Can we identify what changed and why this test isn't failing on the Win 10 bots? If .weba is a common default, then we should add it as a secondary mapping so that consumers of //net can correctly assign a MIME type to .weba files when no other MIME type hints are available.

Comment 3 by mmenke@chromium.org, Today (15 hours ago)

The bots may not be using an up-to-date image of Windows.  I can repro the failure both on my home and corp machines.

Comment 4 by asanka@chromium.org, Today (14 hours ago)

Gotcha. In that case I'd suggest:

  * Remove that test case.
  * Add a secondary file extension mapping for "audio/webm" -> "weba" along with a comment on where this was commonly observed.
  * Add a test for mapping file extension "weba" -> "audio/webm".

In general an OS change like this will permeate across the internet pretty quickly.

Sign in to add a comment