mirror of
https://github.com/videojs/video.js.git
synced 2024-11-24 08:42:25 +02:00
Fixed a poster test for IE11
This commit is contained in:
parent
b2fe4c6292
commit
f96803a806
@ -28,14 +28,19 @@ module('PosterImage', {
|
||||
test('should create and update a poster image', function(){
|
||||
var posterImage;
|
||||
|
||||
// IE11 adds quotes in the returned background url so need to normalize the result
|
||||
function normalizeUrl(url){
|
||||
return url.replace(new RegExp('\\"', 'g'),'');
|
||||
}
|
||||
|
||||
vjs.BACKGROUND_SIZE_SUPPORTED = true;
|
||||
posterImage = new vjs.PosterImage(this.mockPlayer);
|
||||
equal(posterImage.el().style.backgroundImage, 'url('+this.poster1+')', 'Background image used');
|
||||
equal(normalizeUrl(posterImage.el().style.backgroundImage), 'url('+this.poster1+')', 'Background image used');
|
||||
|
||||
// Update with a new poster source and check the new value
|
||||
this.mockPlayer.poster_ = this.poster2;
|
||||
this.mockPlayer.trigger('posterchange');
|
||||
equal(posterImage.el().style.backgroundImage, 'url('+this.poster2+')', 'Background image updated');
|
||||
equal(normalizeUrl(posterImage.el().style.backgroundImage), 'url('+this.poster2+')', 'Background image updated');
|
||||
});
|
||||
|
||||
test('should create and update a fallback image in older browsers', function(){
|
||||
|
Loading…
Reference in New Issue
Block a user