| RUN(internals.initializeMockMediaSource()) |
| RUN(mock = internals.registerMockCDM()) |
| RUN(mock.supportedDataTypes = ["mock"]) |
| RUN(capabilities.initDataTypes = ["mock"]) |
| RUN(capabilities.videoCapabilities = [{ contentType: 'video/mock; codecs="mock"' }] ) |
| RUN(promise = navigator.requestMediaKeySystemAccess("org.webkit.mock", [capabilities])) |
| Promise resolved OK |
| |
| RUN(promise = mediaKeySystemAccess.createMediaKeys()) |
| Promise resolved OK |
| |
| RUN(mediaKeySession = mediaKeys.createSession("temporary")) |
| EXPECTED (typeof mediaKeySession == 'object') OK |
| |
| RUN(mock.supportedSessionTypes = ["temporary"]) |
| TEST(mediaKeySession = mediaKeys.createSession("persistent-license")) THROWS(DOMException.NOT_SUPPORTED_ERR) OK |
| |
| RUN(mock.supportsSessions = false) |
| TEST(mediaKeySession = mediaKeys.createSession("temporary")) THROWS(DOMException.INVALID_STATE_ERR) OK |
| END OF TEST |
| |