Title: [212356] trunk
Revision
212356
Author
[email protected]
Date
2017-02-15 03:47:19 -0800 (Wed, 15 Feb 2017)

Log Message

[EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
https://bugs.webkit.org/show_bug.cgi?id=168362

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

In MediaKeys::setServerCertificate(), when the CDM implementation
doesn't support server certificates, it should resolve the promise
with the 'false' value, as mandated by the specification, and not
reject it.

A test case in mock-MediaKeys-setServerCertificate.html is updated.

* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::setServerCertificate):

LayoutTests:

Update the certificates-not-supported test case, making sure the promise
is resolved with the 'false' result.

* media/encrypted-media/mock-MediaKeys-setServerCertificate-expected.txt:
* media/encrypted-media/mock-MediaKeys-setServerCertificate.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (212355 => 212356)


--- trunk/LayoutTests/ChangeLog	2017-02-15 10:00:22 UTC (rev 212355)
+++ trunk/LayoutTests/ChangeLog	2017-02-15 11:47:19 UTC (rev 212356)
@@ -1,3 +1,16 @@
+2017-02-15  Zan Dobersek  <[email protected]>
+
+        [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
+        https://bugs.webkit.org/show_bug.cgi?id=168362
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Update the certificates-not-supported test case, making sure the promise
+        is resolved with the 'false' result.
+
+        * media/encrypted-media/mock-MediaKeys-setServerCertificate-expected.txt:
+        * media/encrypted-media/mock-MediaKeys-setServerCertificate.html:
+
 2017-02-15  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields

Modified: trunk/LayoutTests/media/encrypted-media/mock-MediaKeys-setServerCertificate-expected.txt (212355 => 212356)


--- trunk/LayoutTests/media/encrypted-media/mock-MediaKeys-setServerCertificate-expected.txt	2017-02-15 10:00:22 UTC (rev 212355)
+++ trunk/LayoutTests/media/encrypted-media/mock-MediaKeys-setServerCertificate-expected.txt	2017-02-15 11:47:19 UTC (rev 212356)
@@ -20,6 +20,7 @@
 
 RUN(mock.supportsServerCertificates = false)
 RUN(promise = mediaKeys.setServerCertificate(stringToUInt8Array("valid")))
-Promise rejected correctly OK
+Promise resolved OK
+EXPECTED (false == 'false') OK
 END OF TEST
 

Modified: trunk/LayoutTests/media/encrypted-media/mock-MediaKeys-setServerCertificate.html (212355 => 212356)


--- trunk/LayoutTests/media/encrypted-media/mock-MediaKeys-setServerCertificate.html	2017-02-15 10:00:22 UTC (rev 212355)
+++ trunk/LayoutTests/media/encrypted-media/mock-MediaKeys-setServerCertificate.html	2017-02-15 11:47:19 UTC (rev 212356)
@@ -79,7 +79,10 @@
         function() {
             run('mock.supportsServerCertificates = false');
             run('promise = mediaKeys.setServerCertificate(stringToUInt8Array("valid"))');
-            shouldReject(promise).then(next, next);
+            shouldResolve(promise).then(function(result) {
+                testExpected(result, false);
+                next();
+            }, next);
         },
     ];
     </script>

Modified: trunk/Source/WebCore/ChangeLog (212355 => 212356)


--- trunk/Source/WebCore/ChangeLog	2017-02-15 10:00:22 UTC (rev 212355)
+++ trunk/Source/WebCore/ChangeLog	2017-02-15 11:47:19 UTC (rev 212356)
@@ -1,3 +1,20 @@
+2017-02-15  Zan Dobersek  <[email protected]>
+
+        [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
+        https://bugs.webkit.org/show_bug.cgi?id=168362
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        In MediaKeys::setServerCertificate(), when the CDM implementation
+        doesn't support server certificates, it should resolve the promise
+        with the 'false' value, as mandated by the specification, and not
+        reject it.
+
+        A test case in mock-MediaKeys-setServerCertificate.html is updated.
+
+        * Modules/encryptedmedia/MediaKeys.cpp:
+        (WebCore::MediaKeys::setServerCertificate):
+
 2017-02-15  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields

Modified: trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp (212355 => 212356)


--- trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp	2017-02-15 10:00:22 UTC (rev 212355)
+++ trunk/Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp	2017-02-15 11:47:19 UTC (rev 212356)
@@ -78,7 +78,7 @@
     // 1. If the Key System implementation represented by this object's cdm implementation value does not support
     //    server certificates, return a promise resolved with false.
     if (!m_implementation->supportsServerCertificates()) {
-        promise->reject(false);
+        promise->resolve<IDLBoolean>(false);
         return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to