Last active
August 29, 2015 13:57
-
-
Save gkatsev/9790249 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test('patchCanPlayType patches canplaytype with our function, conditionally', function() { | |
var oldAV = vjs.ANDROID_VERSION, | |
video = document.createElement('video'), | |
canPlayType = vjs.TEST_VID.constructor.prototype.canPlayType, | |
patchedCanPlayType, | |
unpatchedCanPlayType; | |
vjs.ANDROID_VERSION = 4.0; | |
vjs.Html5.patchCanPlayType(); | |
notStrictEqual(video.canPlayType, canPlayType, 'original canPlayType and patched canPlayType should not be equal'); | |
patchedCanPlayType = video.canPlayType; | |
unpatchedCanPlayType = vjs.Html5.unpatchCanPlayType(); | |
if (canPlayType) { | |
strictEqual(canPlayType, vjs.TEST_VID.constructor.prototype.canPlayType, 'original canPlayType and unpatched canPlayType should be equal'); | |
strictEqual(patchedCanPlayType, unpatchedCanPlayType, 'patched canPlayType and function returned from unpatch are equal'); | |
} | |
vjs.ANDROID_VERSION = oldAV; | |
vjs.Html5.unpatchCanPlayType(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment