2019-01-27 18:05:20 +00:00
|
|
|
import UserAgentParser from "helper/ua-parser";
|
2016-03-16 17:12:40 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
var parsed = new UserAgentParser().getBrowser();
|
2016-03-16 17:12:40 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
var name = parsed.name;
|
2016-03-16 17:12:40 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
var version = parseInt(parsed.major);
|
2016-03-16 17:12:40 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
function is(browser, above){
|
|
|
|
above = above || 0;
|
|
|
|
return name === browser && version >= above;
|
|
|
|
}
|
2016-03-16 17:12:40 +00:00
|
|
|
|
2019-01-27 18:05:20 +00:00
|
|
|
function isnt(browser, below){
|
|
|
|
below = below || Infinity;
|
|
|
|
return !(name === browser && version <= below);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
//setValueCurveAtTime interpolates
|
|
|
|
INTERPOLATED_VALUE_CURVE : is("Chrome", 46),
|
|
|
|
//waveshaper has correct value at 0
|
|
|
|
WAVESHAPER_0_POSITION : isnt("Safari"),
|
|
|
|
//has stereo panner node
|
|
|
|
STEREO_PANNER_NODE : isnt("Safari"),
|
|
|
|
//can schedule a mixture of curves correctly
|
|
|
|
ACCURATE_SIGNAL_SCHEDULING : isnt("Safari"),
|
|
|
|
//can disconnect from a specific node
|
|
|
|
NODE_DISCONNECT : is("Chrome", 50),
|
|
|
|
//stereo panner is equal power panning
|
|
|
|
EQUAL_POWER_PANNER : isnt("Firefox"),
|
|
|
|
//doesn't seem to support the pluck synth
|
|
|
|
PLUCK_SYNTH : isnt("Safari"),
|
|
|
|
//offline rendering matches Chrome closely
|
|
|
|
//chrome is the platform the files were rendered on
|
|
|
|
//so it is the default for continuity testing
|
|
|
|
CHROME_AUDIO_RENDERING : is("Chrome"),
|
|
|
|
//has float time domain analyser
|
|
|
|
ANALYZE_FLOAT_TIME_DOMAIN : AnalyserNode && typeof AnalyserNode.prototype.getFloatTimeDomainData === "function",
|
|
|
|
//if the tests run in focus
|
|
|
|
ONLINE_TESTING : is("Chrome", 72),
|
|
|
|
//the close method resolves a promise
|
|
|
|
AUDIO_CONTEXT_CLOSE_RESOLVES : isnt("Firefox") && isnt("Safari", 10),
|
|
|
|
//if it supports gUM testing
|
|
|
|
GET_USER_MEDIA : isnt("Safari"),
|
|
|
|
RUN_EXAMPLES : isnt("Safari", 10)
|
|
|
|
};
|
2016-03-16 17:12:40 +00:00
|
|
|
|