Unreviewed, rolling out r255050.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2020 18:53:04 +0000 (18:53 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2020 18:53:04 +0000 (18:53 +0000)
Introduced crashes on bots

Reverted changeset:

"[Cocoa] Media mime types map should be created in the UI
process"
https://bugs.webkit.org/show_bug.cgi?id=206478
https://trac.webkit.org/changeset/255050

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@255081 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/MIMETypeRegistry.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebProcessCreationParameters.cpp
Source/WebKit/Shared/WebProcessCreationParameters.h
Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit/MimeTypes.mm [deleted file]

index 9afcaf5..07c8c2f 100644 (file)
@@ -1,3 +1,16 @@
+2020-01-24  Per Arne Vollan  <pvollan@apple.com>
+
+        Unreviewed, rolling out r255050.
+
+        Introduced crashes on bots
+
+        Reverted changeset:
+
+        "[Cocoa] Media mime types map should be created in the UI
+        process"
+        https://bugs.webkit.org/show_bug.cgi?id=206478
+        https://trac.webkit.org/changeset/255050
+
 2020-01-24  Andres Gonzalez  <andresg_22@apple.com>
 
         Implementation of AXIsolatedObject::isStaticText and isLandmark methods.
index c24c8fc..3fa4c26 100644 (file)
@@ -274,18 +274,98 @@ const HashSet<String, ASCIICaseInsensitiveHash>& MIMETypeRegistry::unsupportedTe
     return unsupportedTextMIMETypes;
 }
 
-Optional<HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>>& overriddenMimeTypesMap()
+static const Vector<String>* typesForCommonExtension(const String& extension)
 {
-    static NeverDestroyed<Optional<HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>>> map;
-    return map;
-}
+    static const auto map = makeNeverDestroyed([] {
+        struct TypeExtensionPair {
+            ASCIILiteral type;
+            ASCIILiteral extension;
+        };
+
+        // A table of common media MIME types and file extentions used when a platform's
+        // specific MIME type lookup doesn't have a match for a media file extension.
+        static const TypeExtensionPair commonMediaTypes[] = {
+            // Ogg
+            { "application/ogg"_s, "ogx"_s },
+            { "audio/ogg"_s, "ogg"_s },
+            { "audio/ogg"_s, "oga"_s },
+            { "video/ogg"_s, "ogv"_s },
+
+            // Annodex
+            { "application/annodex"_s, "anx"_s },
+            { "audio/annodex"_s, "axa"_s },
+            { "video/annodex"_s, "axv"_s },
+            { "audio/speex"_s, "spx"_s },
+
+            // WebM
+            { "video/webm"_s, "webm"_s },
+            { "audio/webm"_s, "webm"_s },
+
+            // MPEG
+            { "audio/mpeg"_s, "m1a"_s },
+            { "audio/mpeg"_s, "m2a"_s },
+            { "audio/mpeg"_s, "m1s"_s },
+            { "audio/mpeg"_s, "mpa"_s },
+            { "video/mpeg"_s, "mpg"_s },
+            { "video/mpeg"_s, "m15"_s },
+            { "video/mpeg"_s, "m1s"_s },
+            { "video/mpeg"_s, "m1v"_s },
+            { "video/mpeg"_s, "m75"_s },
+            { "video/mpeg"_s, "mpa"_s },
+            { "video/mpeg"_s, "mpeg"_s },
+            { "video/mpeg"_s, "mpm"_s },
+            { "video/mpeg"_s, "mpv"_s },
+
+            // MPEG playlist
+            { "application/vnd.apple.mpegurl"_s, "m3u8"_s },
+            { "application/mpegurl"_s, "m3u8"_s },
+            { "application/x-mpegurl"_s, "m3u8"_s },
+            { "audio/mpegurl"_s, "m3url"_s },
+            { "audio/x-mpegurl"_s, "m3url"_s },
+            { "audio/mpegurl"_s, "m3u"_s },
+            { "audio/x-mpegurl"_s, "m3u"_s },
+
+            // MPEG-4
+            { "video/x-m4v"_s, "m4v"_s },
+            { "audio/x-m4a"_s, "m4a"_s },
+            { "audio/x-m4b"_s, "m4b"_s },
+            { "audio/x-m4p"_s, "m4p"_s },
+            { "audio/mp4"_s, "m4a"_s },
+
+            // MP3
+            { "audio/mp3"_s, "mp3"_s },
+            { "audio/x-mp3"_s, "mp3"_s },
+            { "audio/x-mpeg"_s, "mp3"_s },
+
+            // MPEG-2
+            { "video/x-mpeg2"_s, "mp2"_s },
+            { "video/mpeg2"_s, "vob"_s },
+            { "video/mpeg2"_s, "mod"_s },
+            { "video/m2ts"_s, "m2ts"_s },
+            { "video/x-m2ts"_s, "m2t"_s },
+            { "video/x-m2ts"_s, "ts"_s },
+
+            // 3GP/3GP2
+            { "audio/3gpp"_s, "3gpp"_s },
+            { "audio/3gpp2"_s, "3g2"_s },
+            { "application/x-mpeg"_s, "amc"_s },
+
+            // AAC
+            { "audio/aac"_s, "aac"_s },
+            { "audio/aac"_s, "adts"_s },
+            { "audio/x-aac"_s, "m4r"_s },
+
+            // CoreAudio File
+            { "audio/x-caf"_s, "caf"_s },
+            { "audio/x-gsm"_s, "gsm"_s },
+
+            // ADPCM
+            { "audio/x-wav"_s, "wav"_s },
+            { "audio/vnd.wave"_s, "wav"_s },
+        };
 
-const HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>& commonMimeTypesMap()
-{
-    ASSERT(isMainThread());
-    static NeverDestroyed<HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>> mimeTypesMap = [] {
         HashMap<String, Vector<String>, ASCIICaseInsensitiveHash> map;
-        for (auto& pair : commonMediaTypes()) {
+        for (auto& pair : commonMediaTypes) {
             ASCIILiteral type = pair.type;
             ASCIILiteral extension = pair.extension;
             map.ensure(extension, [type, extension] {
@@ -299,20 +379,9 @@ const HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>& commonMimeTypes
             }).iterator->value.append(type);
         }
         return map;
-    }();
-    return mimeTypesMap;
-}
-
-static const Vector<String>* typesForCommonExtension(const String& extension)
-{
-    if (overriddenMimeTypesMap().hasValue()) {
-        auto mapEntry = overriddenMimeTypesMap()->find(extension);
-        if (mapEntry == overriddenMimeTypesMap()->end())
-            return nullptr;
-        return &mapEntry->value;
-    }
-    auto mapEntry = commonMimeTypesMap().find(extension);
-    if (mapEntry == commonMimeTypesMap().end())
+    }());
+    auto mapEntry = map.get().find(extension);
+    if (mapEntry == map.get().end())
         return nullptr;
     return &mapEntry->value;
 }
index 7088d9b..1ae2b49 100644 (file)
@@ -31,9 +31,6 @@
 
 namespace WebCore {
 
-WEBCORE_EXPORT Optional<HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>>& overriddenMimeTypesMap();
-WEBCORE_EXPORT const HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>& commonMimeTypesMap();
-
 struct MIMETypeRegistryThreadGlobalData {
     WTF_MAKE_NONCOPYABLE(MIMETypeRegistryThreadGlobalData);
     WTF_MAKE_FAST_ALLOCATED;
@@ -55,7 +52,7 @@ public:
     // FIXME: WebKit coding style says we should not have the word "get" in the names of these functions.
     static Vector<String> getExtensionsForMIMEType(const String& type);
     WEBCORE_EXPORT static String getPreferredExtensionForMIMEType(const String& type);
-    WEBCORE_EXPORT static String getMediaMIMETypeForExtension(const String& extension);
+    static String getMediaMIMETypeForExtension(const String& extension);
     static Vector<String> getMediaMIMETypesForExtension(const String& extension);
 
     static String getMIMETypeForPath(const String& path);
@@ -147,95 +144,4 @@ private:
 
 WEBCORE_EXPORT const String& defaultMIMEType();
 
-struct TypeExtensionPair {
-    ASCIILiteral type;
-    ASCIILiteral extension;
-};
-
-constexpr std::initializer_list<TypeExtensionPair> commonMediaTypes()
-{
-    // A table of common media MIME types and file extensions used when a platform's
-    // specific MIME type lookup doesn't have a match for a media file extension.
-    std::initializer_list<TypeExtensionPair> commonMediaTypes = {
-        // Ogg
-        { "application/ogg"_s, "ogx"_s },
-        { "audio/ogg"_s, "ogg"_s },
-        { "audio/ogg"_s, "oga"_s },
-        { "video/ogg"_s, "ogv"_s },
-
-        // Annodex
-        { "application/annodex"_s, "anx"_s },
-        { "audio/annodex"_s, "axa"_s },
-        { "video/annodex"_s, "axv"_s },
-        { "audio/speex"_s, "spx"_s },
-
-        // WebM
-        { "video/webm"_s, "webm"_s },
-        { "audio/webm"_s, "webm"_s },
-
-        // MPEG
-        { "audio/mpeg"_s, "m1a"_s },
-        { "audio/mpeg"_s, "m2a"_s },
-        { "audio/mpeg"_s, "m1s"_s },
-        { "audio/mpeg"_s, "mpa"_s },
-        { "video/mpeg"_s, "mpg"_s },
-        { "video/mpeg"_s, "m15"_s },
-        { "video/mpeg"_s, "m1s"_s },
-        { "video/mpeg"_s, "m1v"_s },
-        { "video/mpeg"_s, "m75"_s },
-        { "video/mpeg"_s, "mpa"_s },
-        { "video/mpeg"_s, "mpeg"_s },
-        { "video/mpeg"_s, "mpm"_s },
-        { "video/mpeg"_s, "mpv"_s },
-
-        // MPEG playlist
-        { "application/vnd.apple.mpegurl"_s, "m3u8"_s },
-        { "application/mpegurl"_s, "m3u8"_s },
-        { "application/x-mpegurl"_s, "m3u8"_s },
-        { "audio/mpegurl"_s, "m3url"_s },
-        { "audio/x-mpegurl"_s, "m3url"_s },
-        { "audio/mpegurl"_s, "m3u"_s },
-        { "audio/x-mpegurl"_s, "m3u"_s },
-
-        // MPEG-4
-        { "video/x-m4v"_s, "m4v"_s },
-        { "audio/x-m4a"_s, "m4a"_s },
-        { "audio/x-m4b"_s, "m4b"_s },
-        { "audio/x-m4p"_s, "m4p"_s },
-        { "audio/mp4"_s, "m4a"_s },
-
-        // MP3
-        { "audio/mp3"_s, "mp3"_s },
-        { "audio/x-mp3"_s, "mp3"_s },
-        { "audio/x-mpeg"_s, "mp3"_s },
-
-        // MPEG-2
-        { "video/x-mpeg2"_s, "mp2"_s },
-        { "video/mpeg2"_s, "vob"_s },
-        { "video/mpeg2"_s, "mod"_s },
-        { "video/m2ts"_s, "m2ts"_s },
-        { "video/x-m2ts"_s, "m2t"_s },
-        { "video/x-m2ts"_s, "ts"_s },
-
-        // 3GP/3GP2
-        { "audio/3gpp"_s, "3gpp"_s },
-        { "audio/3gpp2"_s, "3g2"_s },
-        { "application/x-mpeg"_s, "amc"_s },
-
-        // AAC
-        { "audio/aac"_s, "aac"_s },
-        { "audio/aac"_s, "adts"_s },
-        { "audio/x-aac"_s, "m4r"_s },
-
-        // CoreAudio File
-        { "audio/x-caf"_s, "caf"_s },
-        { "audio/x-gsm"_s, "gsm"_s },
-
-        // ADPCM
-        { "audio/x-wav"_s, "wav"_s },
-        { "audio/vnd.wave"_s, "wav"_s },
-    };
-    return commonMediaTypes;
-}
-
 } // namespace WebCore
index f481d81..e8ea6d3 100644 (file)
 #include "LibWebRTCProvider.h"
 #include "LoaderStrategy.h"
 #include "Location.h"
-#include "MIMETypeRegistry.h"
 #include "MallocStatistics.h"
 #include "MediaDevices.h"
 #include "MediaEngineConfigurationFactory.h"
@@ -5441,9 +5440,4 @@ bool Internals::systemHasBattery() const
 #endif
 }
 
-String Internals::mediaMIMETypeForExtension(const String& extension)
-{
-    return MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
-}
-
 } // namespace WebCore
index 4edba26..752de7a 100644 (file)
@@ -930,8 +930,6 @@ public:
 
     bool systemHasBattery() const;
 
-    String mediaMIMETypeForExtension(const String& extension);
-
 private:
     explicit Internals(Document&);
     Document* contextDocument() const;
index b52c880..f5b3a3a 100644 (file)
@@ -837,6 +837,4 @@ enum CompositingPolicy {
     DOMString systemColorForCSSValue(DOMString cssValue, boolean useDarkModeAppearance, boolean useElevatedUserInterfaceLevel);
 
     boolean systemHasBattery();
-
-    DOMString mediaMIMETypeForExtension(DOMString extension);
 };
index 89ca36a..240af8b 100644 (file)
@@ -1,3 +1,16 @@
+2020-01-24  Per Arne Vollan  <pvollan@apple.com>
+
+        Unreviewed, rolling out r255050.
+
+        Introduced crashes on bots
+
+        Reverted changeset:
+
+        "[Cocoa] Media mime types map should be created in the UI
+        process"
+        https://bugs.webkit.org/show_bug.cgi?id=206478
+        https://trac.webkit.org/changeset/255050
+
 2020-01-24  Brent Fulgham  <bfulgham@apple.com>
 
         [iOS] Add missing sysctl-read permission (already available in macOS sandbox)
index d04a47f..bb9ae45 100644 (file)
@@ -167,7 +167,6 @@ void WebProcessCreationParameters::encode(IPC::Encoder& encoder) const
     encoder << neHelperExtensionHandle;
     encoder << neSessionManagerExtensionHandle;
     encoder << systemHasBattery;
-    encoder << mimeTypesMap;
 #endif
 
 #if PLATFORM(IOS_FAMILY)
@@ -441,12 +440,6 @@ bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreat
     if (!systemHasBattery)
         return false;
     parameters.systemHasBattery = WTFMove(*systemHasBattery);
-
-    Optional<Optional<HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>>> mimeTypesMap;
-    decoder >> mimeTypesMap;
-    if (!mimeTypesMap)
-        return false;
-    parameters.mimeTypesMap = WTFMove(*mimeTypesMap);
 #endif
 
 #if PLATFORM(IOS_FAMILY)
index a8cc197..d7aefee 100644 (file)
@@ -209,7 +209,6 @@ struct WebProcessCreationParameters {
     Optional<SandboxExtension::Handle> neHelperExtensionHandle;
     Optional<SandboxExtension::Handle> neSessionManagerExtensionHandle;
     bool systemHasBattery { false };
-    Optional<HashMap<String, Vector<String>, ASCIICaseInsensitiveHash>> mimeTypesMap;
 #endif
 
 #if PLATFORM(IOS_FAMILY)
index 60852bc..5b6e066 100644 (file)
@@ -47,7 +47,6 @@
 #import "WebProcessMessages.h"
 #import "WindowServerConnection.h"
 #import <WebCore/Color.h>
-#import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/NetworkStorageSession.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/PlatformPasteboard.h>
@@ -354,7 +353,6 @@ void WebProcessPool::platformInitializeWebProcess(const WebProcessProxy& process
         SandboxExtension::createHandleForMachLookup("com.apple.uikit.viewservice.com.apple.WebContentFilter.remoteUI", WTF::nullopt, handle);
         parameters.contentFilterExtensionHandle = WTFMove(handle);
     }
-    parameters.mimeTypesMap = commonMimeTypesMap();
 #endif
     
 #if PLATFORM(IOS_FAMILY)
index 9d49fa2..0c5ffa2 100644 (file)
@@ -59,7 +59,6 @@
 #import <WebCore/HistoryItem.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebCore/LogInitialization.h>
-#import <WebCore/MIMETypeRegistry.h>
 #import <WebCore/MemoryRelease.h>
 #import <WebCore/NSScrollerImpDetails.h>
 #import <WebCore/PerformanceLogging.h>
@@ -261,9 +260,6 @@ void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& para
         SandboxExtension::consumePermanently(*parameters.neSessionManagerExtensionHandle);
     NetworkExtensionContentFilter::setHasConsumedSandboxExtensions(parameters.neHelperExtensionHandle.hasValue() && parameters.neSessionManagerExtensionHandle.hasValue());
     setSystemHasBattery(parameters.systemHasBattery);
-
-    if (parameters.mimeTypesMap)
-        overriddenMimeTypesMap() = WTFMove(parameters.mimeTypesMap);
 #endif
 
 #if PLATFORM(IOS_FAMILY)
index a675649..46b0fa9 100644 (file)
@@ -1,3 +1,16 @@
+2020-01-24  Per Arne Vollan  <pvollan@apple.com>
+
+        Unreviewed, rolling out r255050.
+
+        Introduced crashes on bots
+
+        Reverted changeset:
+
+        "[Cocoa] Media mime types map should be created in the UI
+        process"
+        https://bugs.webkit.org/show_bug.cgi?id=206478
+        https://trac.webkit.org/changeset/255050
+
 2020-01-24  Jonathan Bedard  <jbedard@apple.com>
 
         run-webkit-tests: Handle case where device socket make handle invalid
index a55cc33..5badd91 100644 (file)
                C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C0ADBE8412FCA6B600D2C129 /* simple-form.html */; };
                C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; };
                C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */; };
-               C145CC0C23DA5A1F003A5EEB /* MimeTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */; };
                C1692DCA23D10DAE006E88F7 /* Battery.mm in Sources */ = {isa = PBXBuildFile; fileRef = C1692DC923D10DAE006E88F7 /* Battery.mm */; };
                C20F88A72295B96700D610FA /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C20F88A62295B96700D610FA /* CoreText.framework */; };
                C22FA32B228F8708009D7988 /* TextWidth.mm in Sources */ = {isa = PBXBuildFile; fileRef = C22FA32A228F8708009D7988 /* TextWidth.mm */; };
                C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; };
                C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor.mm; sourceTree = "<group>"; };
                C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor_Bundle.mm; sourceTree = "<group>"; };
-               C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MimeTypes.mm; sourceTree = "<group>"; };
                C1692DC923D10DAE006E88F7 /* Battery.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = Battery.mm; sourceTree = "<group>"; };
                C1D8EE212028E8E3008EB141 /* WebProcessTerminate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessTerminate.mm; sourceTree = "<group>"; };
                C20F88A62295B96700D610FA /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
                        isa = PBXGroup;
                        children = (
                                C1692DC923D10DAE006E88F7 /* Battery.mm */,
-                               C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */,
                                0F139E751A423A5300F590F5 /* WeakObjCPtr.mm */,
                        );
                        name = cocoa;
                                5C0BF8941DD599C900B00328 /* MenuTypesForMouseEvents.mm in Sources */,
                                5165FE04201EE620009F7EC3 /* MessagePortProviders.mm in Sources */,
                                A5B149DE1F5A19EA00C6DAFF /* MIMETypeRegistry.cpp in Sources */,
-                               C145CC0C23DA5A1F003A5EEB /* MimeTypes.mm in Sources */,
                                51CD1C6C1B38CE4300142CA5 /* ModalAlerts.mm in Sources */,
                                7C83E0B61D0A64B300FEBCF3 /* ModalAlertsSPI.cpp in Sources */,
                                7CCE7F011A411AE600447C4C /* MouseMoveAfterCrash.cpp in Sources */,
diff --git a/Tools/TestWebKitAPI/Tests/WebKit/MimeTypes.mm b/Tools/TestWebKitAPI/Tests/WebKit/MimeTypes.mm
deleted file mode 100644 (file)
index a10f85a..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if WK_HAVE_C_SPI
-
-#import "PlatformUtilities.h"
-#import "TestWKWebView.h"
-#import <WebCore/MIMETypeRegistry.h>
-
-TEST(WebKit, MimeTypes)
-{
-    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
-    WKRetainPtr<WKContextRef> context = adoptWK(TestWebKitAPI::Util::createContextForInjectedBundleTest("InternalsInjectedBundleTest"));
-    configuration.get().processPool = (WKProcessPool *)context.get();
-    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 300, 300) configuration:configuration.get() addToWindow:YES]);
-
-    for (auto& pair : WebCore::commonMediaTypes()) {
-        ASCIILiteral extension = pair.extension;
-
-        auto js = [NSString stringWithFormat:@"window.internals.mediaMIMETypeForExtension(\"%s\")", extension.characters()];
-
-        auto mimeType = [webView stringByEvaluatingJavaScript:js];
-
-        ASSERT_TRUE(WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension(extension) == String(mimeType));
-    }
-}
-
-#endif // WK_HAVE_C_SPI