[EME][ClearKey] Add layout test for dynamic change of key and video resolution
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 11:25:08 +0000 (11:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Dec 2018 11:25:08 +0000 (11:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191926

Patch by Yacine Bandou <yacine.bandou@softathome.com> on 2018-12-03
Reviewed by Xabier Rodriguez-Calvar.

       Add new layout tests in order to test the playback of ClearKey encrypted video content with
       a change of key and resolution during decoding.
       The test starts by playing a ClearKey video with a resolution of 240p, then, in the third second,
       the resolution of the video will change to 480p with a new ClearKey key.

* media/content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4: Added.
* media/content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4: Added.
* media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey-expected.txt: Added.
* media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html: Added.
* media/encrypted-media/medias-enc.js:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4 [new file with mode: 0644]
LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4 [new file with mode: 0644]
LayoutTests/media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey-expected.txt [new file with mode: 0644]
LayoutTests/media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html [new file with mode: 0644]
LayoutTests/media/encrypted-media/medias-enc.js
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations

index 97b8dca..b43179f 100644 (file)
@@ -1,3 +1,29 @@
+2018-12-03  Yacine Bandou  <yacine.bandou@softathome.com>
+
+        [EME][ClearKey] Add layout test for dynamic change of key and video resolution
+        https://bugs.webkit.org/show_bug.cgi?id=191926
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+       Add new layout tests in order to test the playback of ClearKey encrypted video content with
+       a change of key and resolution during decoding.
+       The test starts by playing a ClearKey video with a resolution of 240p, then, in the third second,
+       the resolution of the video will change to 480p with a new ClearKey key.
+
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4: Added.
+        * media/content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4: Added.
+        * media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey-expected.txt: Added.
+        * media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html: Added.
+        * media/encrypted-media/medias-enc.js:
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2018-11-30  Youenn Fablet  <youenn@apple.com>
 
         Test that CSS subresource loading are exposed to resource timing in case of a CORS loaded CSS stylesheet but not imported stylesheets
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4
new file mode 100644 (file)
index 0000000..1640963
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4
new file mode 100644 (file)
index 0000000..995c1e9
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4
new file mode 100644 (file)
index 0000000..858ce4f
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4
new file mode 100644 (file)
index 0000000..4cbf3a2
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4
new file mode 100644 (file)
index 0000000..05ea349
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4
new file mode 100644 (file)
index 0000000..4d80c5c
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4
new file mode 100644 (file)
index 0000000..848f928
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4 differ
diff --git a/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4 b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4
new file mode 100644 (file)
index 0000000..b60c56c
Binary files /dev/null and b/LayoutTests/media/content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4 differ
diff --git a/LayoutTests/media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey-expected.txt b/LayoutTests/media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey-expected.txt
new file mode 100644 (file)
index 0000000..563ab44
--- /dev/null
@@ -0,0 +1,15 @@
+
+EME API is supported OK
+Media source is opened OK
+EVENT(encrypted)
+MediaKeys is created OK
+EVENT(message)
+EVENT(keystatuseschange)
+Session: keyId=d0d1d2d3d4d5d6d7d8d9dadbdcdddedf status=usable OK
+EVENT(encrypted)
+EVENT(message)
+EVENT(keystatuseschange)
+Session: keyId=b0b1b2b3b4b5b6b7b8b9babbbcbdbebf status=usable OK
+EXPECTED (video.currentTime >= '4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html b/LayoutTests/media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html
new file mode 100644 (file)
index 0000000..1a8ca4b
--- /dev/null
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Playback ClearKey CENC video with multi keys and multi resolutions </title>
+    <script src="../medias-enc.js"></script>
+    <script src="../../video-test.js"></script>
+    <script src="../../media-source/media-source-loader-simple.js"></script>
+    <script src="encrypted-media-clearKey-handler.js"></script>
+    <script>
+
+    const videoConf = streamMedias["multiKeyClearKeyVideoMSE"].video;
+
+    function runTest() {
+
+        findMediaElement();
+
+        const emeHandler = new EncryptedMediaHandler(video, videoConf);
+        if (!emeHandler)
+            endTest();
+
+        video.addEventListener('timeupdate', function onTimeUpdate(event) {
+
+            if (video.paused)
+                endTest();
+            else if (video.currentTime >= 4) {
+                testExpected("video.currentTime", 4, ">=")
+                endTest();
+            }
+        });
+
+        const ms = new MediaSourceLoaderSimple(video);
+        ms.onready = function() {
+            logResult(true, "Media source is opened");
+            ms.createSourceBuffer(videoConf, 8);
+            video.play();
+        };
+    }
+    </script>
+</head>
+<body onload="runTest()">
+    <video></video>
+</body>
+</html>
index 4ebad4c..7fd591b 100644 (file)
@@ -29,5 +29,21 @@ const streamMedias = {
                                             segments     : [ "../../content/encrypted/VideoClearKeyWebM.webm" ],
                                             keys         : {    "30313233343536373839303132333435" : "4d24cb6b0de1abe880e4d5983df03c93" }
                                        }
-                          }
+                          },
+     "multiKeyClearKeyVideoMSE" : { video : {    initDataType : "cenc",
+                                                 mimeType     : 'video/mp4; codecs="avc1.64001F"',
+                                                 segments     : [ "../../content/encrypted/segments/VideoClearKeyCenc-seg-240-0.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-240-1.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-240-2.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-240-3.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-480-0.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-480-4.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-480-5.mp4",
+                                                                  "../../content/encrypted/segments/VideoClearKeyCenc-seg-480-6.mp4",
+                                                                ],
+                                                 keys         : {    "d0d1d2d3d4d5d6d7d8d9dadbdcdddedf" : "c0c1c2c3c4c5c6c7c8c9cacbcccdcecf",
+                                                                     "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf" : "a0a1a2a3a4a5a6a7a8a9aaabacadaeaf"
+                                                                }
+                                            }
+                                  }
                    };
index 5689d88..502384c 100644 (file)
@@ -2418,6 +2418,7 @@ webkit.org/b/188106 webgl/1.0.2/conformance/ogles/GL/swizzlers/swizzlers_017_to_
 
 webkit.org/b/190738 media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html [ Timeout ]
 webkit.org/b/190738 media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html [ Timeout ]
+media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html [ Skip ]
 
 webkit.org/b/191008 webanimations/accelerated-animation-suspension.html [ Timeout ]
 
index 4ef871d..7ca2206 100644 (file)
@@ -1327,6 +1327,7 @@ webkit.org/b/180928 media/encrypted-media/clearKey/clearKey-message-cenc-event-m
 webkit.org/b/181594 media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html [ Skip ]
 webkit.org/b/181594 media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html [ Skip ]
 webkit.org/b/189200 media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html [ Skip ]
+media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse-multikey.html [ Skip ]
 
 webkit.org/b/162507 http/tests/media/hls/hls-video-resize.html [ Pass Failure ]