Browse Source

test: Set devicePixelRatio to 1 for tests to prevent local failures (#790)

pull/792/head
Brandon Casey 5 years ago
committed by GitHub
parent
commit
92a34c6f35
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      test/master-playlist-controller.test.js
  2. 9
      test/videojs-http-streaming.test.js

8
test/master-playlist-controller.test.js

@ -52,6 +52,11 @@ QUnit.module('MasterPlaylistController', {
this.requests = this.env.requests;
this.mse = useFakeMediaSource();
if (!videojs.browser.IE_VERSION) {
this.oldDevicePixelRatio = window.devicePixelRatio;
window.devicePixelRatio = 1;
}
// force the HLS tech to run
this.origSupportsNativeHls = videojs.Hls.supportsNativeHls;
videojs.Hls.supportsNativeHls = false;
@ -84,6 +89,9 @@ QUnit.module('MasterPlaylistController', {
this.mse.restore();
videojs.Hls.supportsNativeHls = this.origSupportsNativeHls;
window.localStorage.clear();
if (this.hasOwnProperty('oldDevicePixelRatio')) {
window.devicePixelRatio = this.oldDevicePixelRatio;
}
videojs.browser = this.oldBrowser;
this.player.dispose();
}

9
test/videojs-http-streaming.test.js

@ -67,7 +67,10 @@ QUnit.module('HLS', {
this.mse = useFakeMediaSource();
this.clock = this.env.clock;
this.old = {};
if (!videojs.browser.IE_VERSION) {
this.old.devicePixelRatio = window.devicePixelRatio;
window.devicePixelRatio = 1;
}
// store functionality that some tests need to mock
this.old.GlobalOptions = videojs.mergeOptions(videojs.options);
@ -103,6 +106,10 @@ QUnit.module('HLS', {
this.env.restore();
this.mse.restore();
if (this.old.hasOwnProperty('devicePixelRatio')) {
window.devicePixelRatio = this.old.devicePixelRatio;
}
merge(videojs.options, this.old.GlobalOptions);
videojs.Hls.supportsNativeHls = this.old.NativeHlsSupport;

Loading…
Cancel
Save