[Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changety...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2018 17:24:50 +0000 (17:24 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Nov 2018 17:24:50 +0000 (17:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191396

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Modify the changetype test suite to include a HEVC version.

* web-platform-tests/media-source/hevc/test-v-128k-320x240-24fps-8kfr.mp4: Added.
* web-platform-tests/media-source/mediasource-changetype-util.js:
(findSupportedChangeTypeTestTypes):

Source/WebCore:

When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
from "same codec" requirements.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::validateInitializationSegment):

LayoutTests:

* platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/media-source/hevc/test-v-128k-320x240-24fps-8kfr.mp4 [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/media-source/mediasource-changetype-util.js
LayoutTests/platform/mac-sierra/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/SourceBuffer.cpp

index 810e906..fb1c0c6 100644 (file)
@@ -1,3 +1,13 @@
+2018-11-09  Jer Noble  <jer.noble@apple.com>
+
+        [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
+        https://bugs.webkit.org/show_bug.cgi?id=191396
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt:
+        * platform/mac-sierra/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt:
+
 2018-11-09  Ryan Haddad  <ryanhaddad@apple.com>
 
         Clean up test expectations after r237942
index dbfaae0..0912bde 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-09  Jer Noble  <jer.noble@apple.com>
+
+        [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
+        https://bugs.webkit.org/show_bug.cgi?id=191396
+
+        Reviewed by Eric Carlson.
+
+        Modify the changetype test suite to include a HEVC version.
+
+        * web-platform-tests/media-source/hevc/test-v-128k-320x240-24fps-8kfr.mp4: Added.
+        * web-platform-tests/media-source/mediasource-changetype-util.js:
+        (findSupportedChangeTypeTestTypes):
+
 2018-11-08  Andy Estes  <aestes@apple.com>
 
         [Payment Request] Update web platform tests
diff --git a/LayoutTests/imported/w3c/web-platform-tests/media-source/hevc/test-v-128k-320x240-24fps-8kfr.mp4 b/LayoutTests/imported/w3c/web-platform-tests/media-source/hevc/test-v-128k-320x240-24fps-8kfr.mp4
new file mode 100644 (file)
index 0000000..1dcd630
Binary files /dev/null and b/LayoutTests/imported/w3c/web-platform-tests/media-source/hevc/test-v-128k-320x240-24fps-8kfr.mp4 differ
index 4e24223..0d6fedc 100644 (file)
@@ -19,6 +19,11 @@ function findSupportedChangeTypeTestTypes(cb)
             url: 'mp4/test-v-128k-320x240-24fps-8kfr.mp4'
         },
         {
+            type: 'video/mp4; codecs="hvc1.1.6.L60.90"',
+            is_video: true,
+            url: 'hevc/test-v-128k-320x240-24fps-8kfr.mp4'
+        },
+        {
             type: 'audio/webm; codecs="vorbis"',
             is_video: false,
             url: 'webm/test-a-128k-44100Hz-1ch.webm'
diff --git a/LayoutTests/platform/mac-sierra/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt b/LayoutTests/platform/mac-sierra/imported/w3c/web-platform-tests/media-source/mediasource-changetype-play-expected.txt
new file mode 100644 (file)
index 0000000..46062ce
--- /dev/null
@@ -0,0 +1,8 @@
+
+FAIL Check if browser supports enough test media types assert_true: Browser doesn't support at least 2 types of video test media expected true got false
+PASS Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mp4; codecs="mp4a.40.2" 
+PASS Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mpeg 
+PASS Test audio-only changeType for audio/mpeg <-> audio/mp4; codecs="mp4a.40.2" 
+PASS Test audio-only changeType for audio/mpeg <-> audio/mpeg 
+PASS Test video-only changeType for video/mp4; codecs="avc1.4D4001" <-> video/mp4; codecs="avc1.4D4001" 
+
index 46062ce..ecacca3 100644 (file)
@@ -1,8 +1,11 @@
 
-FAIL Check if browser supports enough test media types assert_true: Browser doesn't support at least 2 types of video test media expected true got false
+PASS Check if browser supports enough test media types 
 PASS Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mp4; codecs="mp4a.40.2" 
 PASS Test audio-only changeType for audio/mp4; codecs="mp4a.40.2" <-> audio/mpeg 
 PASS Test audio-only changeType for audio/mpeg <-> audio/mp4; codecs="mp4a.40.2" 
 PASS Test audio-only changeType for audio/mpeg <-> audio/mpeg 
 PASS Test video-only changeType for video/mp4; codecs="avc1.4D4001" <-> video/mp4; codecs="avc1.4D4001" 
+PASS Test video-only changeType for video/mp4; codecs="avc1.4D4001" <-> video/mp4; codecs="hvc1.1.6.L60.90" 
+PASS Test video-only changeType for video/mp4; codecs="hvc1.1.6.L60.90" <-> video/mp4; codecs="avc1.4D4001" 
+PASS Test video-only changeType for video/mp4; codecs="hvc1.1.6.L60.90" <-> video/mp4; codecs="hvc1.1.6.L60.90" 
 
index 2320bf4..c32691d 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-09  Jer Noble  <jer.noble@apple.com>
+
+        [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
+        https://bugs.webkit.org/show_bug.cgi?id=191396
+
+        Reviewed by Eric Carlson.
+
+        When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
+        from "same codec" requirements.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::validateInitializationSegment):
+
 2018-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         REGRESSION(r236365): [GTK] Many form-related tests are failing
index 0beb9f6..57e84f0 100644 (file)
@@ -1314,16 +1314,16 @@ bool SourceBuffer::validateInitializationSegment(const InitializationSegment& se
             if (!m_audioCodecs.contains(audioTrackInfo.description->codec()))
                 return false;
         }
-    }
 
-    for (auto& videoTrackInfo : segment.videoTracks) {
-        if (!m_videoCodecs.contains(videoTrackInfo.description->codec()))
-            return false;
-    }
+        for (auto& videoTrackInfo : segment.videoTracks) {
+            if (!m_videoCodecs.contains(videoTrackInfo.description->codec()))
+                return false;
+        }
 
-    for (auto& textTrackInfo : segment.textTracks) {
-        if (!m_textCodecs.contains(textTrackInfo.description->codec()))
-            return false;
+        for (auto& textTrackInfo : segment.textTracks) {
+            if (!m_textCodecs.contains(textTrackInfo.description->codec()))
+                return false;
+        }
     }
 
     //   * If more than one track for a single type are present (ie 2 audio tracks), then the Track