blob: 120ba1f2c287ceb768ef0a6f4a2f8e492eea4aa0 [file] [log] [blame]
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(mock.canCreateInstances = false)
RUN(promise = mediaKeySystemAccess.createMediaKeys())
Promise rejected correctly OK
RUN(mock.canCreateInstances = true)
RUN(capabilities.distinctiveIdentifier = "not-allowed")
RUN(promise = navigator.requestMediaKeySystemAccess("org.webkit.mock", [capabilities]))
Promise resolved OK
RUN(promise = mediaKeySystemAccess.createMediaKeys())
Promise resolved OK
RUN(mock.distinctiveIdentifiersRequirement = "required")
RUN(promise = mediaKeySystemAccess.createMediaKeys())
Promise rejected correctly OK
RUN(mock.distinctiveIdentifiersRequirement = "optional")
RUN(capabilities.persistentState = "not-allowed")
RUN(promise = navigator.requestMediaKeySystemAccess("org.webkit.mock", [capabilities]))
Promise resolved OK
RUN(testRunner.setIsMediaKeySystemPermissionGranted(false))
RUN(promise = navigator.requestMediaKeySystemAccess("org.webkit.mock", [capabilities]))
Promise rejected correctly OK
RUN(promise = mediaKeySystemAccess.createMediaKeys())
Promise resolved OK
RUN(mock.persistentStateRequirement = "required")
RUN(promise = mediaKeySystemAccess.createMediaKeys())
Promise rejected correctly OK
END OF TEST