Enable MediaSource::isTypeSupported() to handle the upper-cased MIME type & Codec
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 16:11:45 +0000 (16:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 16:11:45 +0000 (16:11 +0000)
Source/WebCore:

https://bugs.webkit.org/show_bug.cgi?id=150436

Patch by Hyunduk Kim <hyunduk.kim@samsung.com> on 2015-11-02
Reviewed by Darin Adler.

Got the new test case from
https://github.com/w3c/web-platform-tests/blob/master/media-source/mediasource-is-type-supported.html
Tests: http\tests\media\media-source\mediasource-is-type-supported.html

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::isTypeSupported):

LayoutTests:

I got the changes from
https://github.com/w3c/web-platform-tests/blob/master/media-source/mediasource-is-type-supported.html
https://bugs.webkit.org/show_bug.cgi?id=150436

Patch by Hyunduk Kim <hyunduk.kim@samsung.com> on 2015-11-02
Reviewed by Darin Adler.

* http/tests/media/media-source/mediasource-is-type-supported-expected.txt:
* http/tests/media/media-source/mediasource-is-type-supported.html:
* platform/mac/http/tests/media/media-source/mediasource-is-type-supported-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/http/tests/media/media-source/mediasource-is-type-supported-expected.txt [changed mode: 0644->0755]
LayoutTests/http/tests/media/media-source/mediasource-is-type-supported.html [changed mode: 0644->0755]
LayoutTests/platform/mac/http/tests/media/media-source/mediasource-is-type-supported-expected.txt [changed mode: 0644->0755]
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/MediaSource.cpp

index a267db6..c51a385 100644 (file)
@@ -1,3 +1,16 @@
+2015-11-02  Hyunduk Kim  <hyunduk.kim@samsung.com>
+
+        Enable MediaSource::isTypeSupported() to handle the upper-cased MIME type & Codec
+        I got the changes from
+        https://github.com/w3c/web-platform-tests/blob/master/media-source/mediasource-is-type-supported.html
+        https://bugs.webkit.org/show_bug.cgi?id=150436
+
+        Reviewed by Darin Adler.
+
+        * http/tests/media/media-source/mediasource-is-type-supported-expected.txt:
+        * http/tests/media/media-source/mediasource-is-type-supported.html:
+        * platform/mac/http/tests/media/media-source/mediasource-is-type-supported-expected.txt:
+
 2015-10-29  Sergio Villar Senin  <svillar@igalia.com>
 
         [CSS Grid Layout] min-content row does not always shrink
old mode 100644 (file)
new mode 100755 (executable)
index 9d3b34d..d55f9fd
@@ -24,7 +24,9 @@ PASS Test valid WebM type "video/webm;codecs="vp8""
 PASS Test valid WebM type "video/webm;codecs="vorbis"" 
 PASS Test valid WebM type "video/webm;codecs="vp8,vorbis"" 
 PASS Test valid WebM type "video/webm;codecs="vorbis, vp8"" 
-PASS Test valid WebM type "audio/webm;codecs="vorbis"" 
+PASS Test valid WebM type "audio/webm;codecs="vorbis""
+PASS Test valid WebM type "AUdio/WebM;codECS="VoRbiS""
+PASS Test valid WebM type "AUDIO/WEBM;CODECS="VORBIS""
 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" 
 PASS Test valid MP4 type "video/mp4;codecs="avc1.42001e"" 
 PASS Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" 
@@ -34,4 +36,6 @@ PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2""
 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" 
 PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" 
 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" 
+PASS Test valid MP4 type "VIdeo/Mp4;CDdeCS="mp4A.40.2"" 
+PASS Test valid MP4 type "VIDEO/MP4;CDDECS="MP4A.40.2"" 
 
old mode 100644 (file)
new mode 100755 (executable)
index 286ad37..c07dd4a
@@ -58,6 +58,8 @@
               'video/webm;codecs="vp8,vorbis"',
               'video/webm;codecs="vorbis, vp8"',
               'audio/webm;codecs="vorbis"',
+              'AUdio/WebM;codECS="VoRbiS"',
+              'AUDIO/WEBM;CODECS="VORBIS"',
           ], true, 'Test valid WebM type');
 
           test_type_support([
@@ -70,6 +72,8 @@
               'video/mp4;codecs="avc1.4d001e,mp4a.40.2"',
               'video/mp4;codecs="mp4a.40.2 , avc1.4d001e "',
               'video/mp4;codecs="avc1.4d001e,mp4a.40.5"',
+              'VIdeo/Mp4;CDdeCS="mp4A.40.2"',
+              'VIDEO/MP4;CDDECS="MP4A.40.2"',
           ], true, 'Test valid MP4 type');
         </script>
     </body>
old mode 100644 (file)
new mode 100755 (executable)
index 7a3387a..b8d455e
@@ -73,6 +73,20 @@ step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
 test@http://127.0.0.1:8000/w3c/resources/testharness.js:443:22
 test_type_support@http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:14:23
 global code@http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:55:28)
+FAIL Test valid WebM type "AUdio/WebM;codECS="VoRbiS"" assert_equals: supported expected true but got false(stack: assert@http://127.0.0.1:8000/w3c/resources/testharness.js:2060:37
+assert_equals@http://127.0.0.1:8000/w3c/resources/testharness.js:699:15
+http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:16:36
+step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
+test@http://127.0.0.1:8000/w3c/resources/testharness.js:443:22
+test_type_support@http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:14:23
+global code@http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:55:28)
+FAIL Test valid WebM type "AUDIO/WEBM;CODECS="VORBIS"" assert_equals: supported expected true but got false(stack: assert@http://127.0.0.1:8000/w3c/resources/testharness.js:2060:37
+assert_equals@http://127.0.0.1:8000/w3c/resources/testharness.js:699:15
+http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:16:36
+step@http://127.0.0.1:8000/w3c/resources/testharness.js:1160:30
+test@http://127.0.0.1:8000/w3c/resources/testharness.js:443:22
+test_type_support@http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:14:23
+global code@http://127.0.0.1:8000/media/media-source/mediasource-is-type-supported.html:55:28)
 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e"" 
 PASS Test valid MP4 type "video/mp4;codecs="avc1.42001e"" 
 PASS Test valid MP4 type "audio/mp4;codecs="mp4a.40.2"" 
@@ -82,4 +96,6 @@ PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2""
 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" 
 PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" 
 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" 
+PASS Test valid MP4 type "VIdeo/Mp4;CDdeCS="mp4A.40.2"" 
+PASS Test valid MP4 type "VIDEO/MP4;CDDECS="MP4A.40.2"" 
 
index f802f9a..7e7f53f 100644 (file)
@@ -1,3 +1,17 @@
+2015-11-02  Hyunduk Kim  <hyunduk.kim@samsung.com>
+
+        Enable MediaSource::isTypeSupported() to handle the upper-cased MIME type & Codec
+        https://bugs.webkit.org/show_bug.cgi?id=150436
+
+        Reviewed by Darin Adler.
+
+        Got the new test case from
+        https://github.com/w3c/web-platform-tests/blob/master/media-source/mediasource-is-type-supported.html 
+        Tests: http\tests\media\media-source\mediasource-is-type-supported.html
+
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::isTypeSupported):
+
 2015-11-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Rename JSDOMWrapper.impl to JSDOMWrapper.wrapped
index c40d6e3..23c37bf 100644 (file)
@@ -732,7 +732,7 @@ bool MediaSource::isTypeSupported(const String& type)
     if (type.isNull() || type.isEmpty())
         return false;
 
-    ContentType contentType(type);
+    ContentType contentType(type.lower());
     String codecs = contentType.parameter("codecs");
 
     // 2. If type does not contain a valid MIME type string, then return false.