blob: a4f2d318fccab2b4f8ffdae3e13b308920be7790 [file] [log] [blame]
RUN(internals.setSystemHasBatteryForTesting(true))
RUN(internals.setSystemHasACForTesting(true))
RUN(internals.setHardwareVP9DecoderDisabledForTesting(true))
RUN(internals.setVP9ScreenSizeAndScaleForTesting(1024, 768, 1))
Test that 4k @ 30fps is supported, smooth, but not powerEfficient
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.08"', height: 1080, bitrate: 800000, width: 3180, framerate: 30 }});)
Promise resolved OK
EXPECTED (info === '{ supported: true, powerEfficient: false, smooth: true }') OK
Test that 4k @ 60fps is supported, but not smooth or powerEfficient
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.08"', height: 1080, bitrate: 800000, width: 3180, framerate: 60 }});)
Promise resolved OK
EXPECTED (info === '{ supported: true, powerEfficient: false, smooth: false }') OK
Test unsupported codec configurations.
Profiles 1 and 3 should be unsupported.
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.01.41.08"', height: 1080, bitrate: 800000, width: 3180, framerate: 30 }});)
Promise resolved OK
EXPECTED (info === '{ supported: false, powerEfficient: false, smooth: false }') OK
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.03.41.08"', height: 1080, bitrate: 800000, width: 3180, framerate: 30 }});)
Promise resolved OK
EXPECTED (info === '{ supported: false, powerEfficient: false, smooth: false }') OK
Pixel depths above 10 are unsupported.
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.12"', height: 1080, bitrate: 800000, width: 3180, framerate: 60 }});)
Promise resolved OK
EXPECTED (info === '{ supported: false, powerEfficient: false, smooth: false }') OK
Chroma subsampling 422 or 444 are unsupported.
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.08.02.01.01.01.01"', height: 1080, bitrate: 800000, width: 3180, framerate: 60 }});)
Promise resolved OK
EXPECTED (info === '{ supported: false, powerEfficient: false, smooth: false }') OK
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.08.03.01.01.01.01"', height: 1080, bitrate: 800000, width: 3180, framerate: 60 }});)
Promise resolved OK
EXPECTED (info === '{ supported: false, powerEfficient: false, smooth: false }') OK
Test that SW VP9 decoder is not supported on battery power when screen is not 4k resolution
RUN(internals.setSystemHasACForTesting(false))
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.08"', height: 1080, bitrate: 800000, width: 3180, framerate: 30 }});)
Promise resolved OK
EXPECTED (info === '{ supported: false, powerEfficient: false, smooth: false }') OK
Test that SW VP9 decoder is supported on battery power when screen is at least 4k resolution
RUN(internals.setVP9ScreenSizeAndScaleForTesting(3840, 2160, 1))
RUN(promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs="vp09.00.41.08"', height: 1080, bitrate: 800000, width: 3180, framerate: 30 }});)
Promise resolved OK
EXPECTED (info === '{ supported: true, powerEfficient: false, smooth: true }') OK
END OF TEST