[EME] Implement MediaKeySession::remove()
https://bugs.webkit.org/show_bug.cgi?id=167870
Reviewed by Xabier Rodriguez-Calvar.
Source/WebCore:
Implement MediaKeySession::remove() as outlined in the specification.
The CDMInstance::removeSessionData() virtual method is added. CDMInstance
implementors should remove any session data stored for the session that's
represented by the passed-in session ID and session type.
Once the session data is removed, the passed-in callback should be invoked
by the CDMInstance object so that MediaKeySession can immediately queue a
task in which it updates key statuses and expiration, reject the promise if
the data removal failed, or enqueue any license-release message and finally
successfully resolve the promise.
MockCDMFactory gains the removeKeysFromSessionWithID() method that purges
the keys for a given session ID. The method is called from
MockCDMInstance::removeSessionData() implementation, which passes the
removed keys to the RemoveSessionDataCallback, along with a license-release
message that is checked in the tests. The key removal itself isn't tested
yet because the MediaKeySession's `update key statuses` algorithm isn't
implemented yet.
Test: media/encrypted-media/mock-MediaKeySession-remove.html
* Modules/encryptedmedia/CDMInstance.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::remove):
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMFactory::removeKeysFromSessionWithID):
(WebCore::MockCDMInstance::removeSessionData):
* testing/MockCDMFactory.h:
LayoutTests:
Add the mock-MediaKeySession-remove.html test that tests the functionality
of the MediaKeySession::remove() implementation. The test checks that the
calls to that method properly resolve or reject the returned promise,
depending on the object state. Another test checks the message that's
queued upon a successful removal.
Additional tests will be added later once MediaKeySession properly
implements the close() method and key status updates.
* media/encrypted-media/mock-MediaKeySession-remove-expected.txt: Added.
* media/encrypted-media/mock-MediaKeySession-remove.html: Added.
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211857
268f45cc-cd09-0410-ab3c-
d52691b4dbfc