|
| 1 | +// Copyright © 2020 The CefSharp Authors. All rights reserved. |
| 2 | +// |
| 3 | +// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +using Xunit; |
| 6 | + |
| 7 | +namespace CefSharp.Test.Framework |
| 8 | +{ |
| 9 | + /// <summary> |
| 10 | + /// MimeTypeMappingFacts - Tests file extension to mimeType mapping |
| 11 | + /// </summary> |
| 12 | + public class MimeTypeMappingFacts |
| 13 | + { |
| 14 | + [Theory] |
| 15 | + [InlineData("html", "text/html")] |
| 16 | + [InlineData(".wasm", "application/wasm")] |
| 17 | + [InlineData(".ogg", "audio/ogg")] |
| 18 | + [InlineData(".oga", "audio/ogg")] |
| 19 | + [InlineData(".ogv", "video/ogg")] |
| 20 | + [InlineData(".opus", "audio/ogg")] |
| 21 | + [InlineData(".webm", "video/webm")] |
| 22 | + [InlineData(".weba", "audio/webm")] |
| 23 | + [InlineData(".webp", "image/webp")] |
| 24 | + [InlineData(".epub", "application/epub+zip")] |
| 25 | + [InlineData(".woff", "application/font-woff")] |
| 26 | + [InlineData(".woff2", "font/woff2")] |
| 27 | + [InlineData(".ttf", "font/ttf")] |
| 28 | + [InlineData(".otf", "font/otf")] |
| 29 | + [InlineData(".dummyextension", "application/octet-stream")] |
| 30 | + public void MapFileExtensionToMimeTypeTheory(string fileExtension, string expectedMimeType) |
| 31 | + { |
| 32 | + var actualMimeType = Cef.GetMimeType(fileExtension); |
| 33 | + Assert.Equal(expectedMimeType, actualMimeType); |
| 34 | + } |
| 35 | + } |
| 36 | +} |
0 commit comments