Add support for MediaKeys.createSession().
[WebKit-https.git] / LayoutTests / media / encrypted-media / mock-MediaKeys-createSession-expected.txt
1 RUN(internals.initializeMockMediaSource())
2 RUN(mock = internals.registerMockCDM())
3 RUN(mock.supportedDataTypes = ["mock"])
4 RUN(capabilities.initDataTypes = ["mock"])
5 RUN(capabilities.videoCapabilities = [{ contentType: 'video/mock; codecs="mock"' }] )
6 RUN(promise = navigator.requestMediaKeySystemAccess("org.webkit.mock", [capabilities]))
7 Promise resolved OK
8
9 RUN(promise = mediaKeySystemAccess.createMediaKeys())
10 Promise resolved OK
11
12 RUN(mediaKeySession = mediaKeys.createSession("temporary"))
13 EXPECTED (typeof mediaKeySession == 'object') OK
14
15 RUN(mock.supportedSessionTypes = ["temporary"])
16 TEST(mediaKeySession = mediaKeys.createSession("persistent-license")) THROWS(DOMException.NOT_SUPPORTED_ERR) OK
17
18 RUN(mock.supportsSessions = false)
19 TEST(mediaKeySession = mediaKeys.createSession("temporary")) THROWS(DOMException.INVALID_STATE_ERR) OK
20 END OF TEST
21