Commit 80a33cc0 authored by Raymond Toy's avatar Raymond Toy Committed by Commit Bot

Deprecate WebAudio Media nodes on an OfflineAudioContext

Print a deprecation message when WebAudio Media nodes
(MediaElementAudioSourceNode, MediaStreamAudioDestinationNode,
MediaStreamAudioSourceNode) are created on an OfflineAudioContext.
Doing so is not allowed in the WebAudio spec.

Intent: https://groups.google.com/a/chromium.org/d/msg/blink-dev/H29uXnsIN54/BKXDqxoJAQAJ
Chrome feature entry: https://www.chromestatus.com/feature/5258622686724096

Bug: 845913
Change-Id: I5247d67456afa11582099f4d52d65a76f788639d
Reviewed-on: https://chromium-review.googlesource.com/1091656
Commit-Queue: Raymond Toy <rtoy@chromium.org>
Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568124}
parent ffe80a57
CONSOLE WARNING: line 371: Delay.delayTime.value -1 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 371: Delay.delayTime.setValueAtTime value -1 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 383: Delay.delayTime.value 4 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 383: Delay.delayTime.setValueAtTime value 4 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 371: StereoPanner.pan.value -3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 371: StereoPanner.pan.setValueAtTime value -3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 383: StereoPanner.pan.value 3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 383: StereoPanner.pan.setValueAtTime value 3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.threshold.value -201 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.threshold.setValueAtTime value -201 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.threshold.value 1 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.threshold.setValueAtTime value 1 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.knee.value -1 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.knee.setValueAtTime value -1 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.knee.value 81 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.knee.setValueAtTime value 81 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.ratio.value 41 outside nominal range [1, 20]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.ratio.setValueAtTime value 41 outside nominal range [1, 20]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.attack.value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.attack.setValueAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.attack.value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.attack.setValueAtTime value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.release.value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 371: DynamicsCompressor.release.setValueAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.release.value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 383: DynamicsCompressor.release.setValueAtTime value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 371: BiquadFilter.frequency.value -1 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 371: BiquadFilter.frequency.setValueAtTime value -1 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 383: BiquadFilter.frequency.value 48001 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 383: BiquadFilter.frequency.setValueAtTime value 48001 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 371: Oscillator.frequency.value -48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 371: Oscillator.frequency.setValueAtTime value -48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 383: Oscillator.frequency.value 48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 383: Oscillator.frequency.setValueAtTime value 48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 302: Delay.delayTime.setValueAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 303: Delay.delayTime.linearRampToValueAtTime value 2 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 304: Delay.delayTime.exponentialRampToValue value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 305: Delay.delayTime.setTargetAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 306: Delay.delayTime.setValueCurveAtTime value 1.5 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 209: The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
CONSOLE WARNING: line 392: Delay.delayTime.value -1 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 392: Delay.delayTime.setValueAtTime value -1 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 404: Delay.delayTime.value 4 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 404: Delay.delayTime.setValueAtTime value 4 outside nominal range [0, 1.5]; value will be clamped.
CONSOLE WARNING: line 392: StereoPanner.pan.value -3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 392: StereoPanner.pan.setValueAtTime value -3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 404: StereoPanner.pan.value 3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 404: StereoPanner.pan.setValueAtTime value 3 outside nominal range [-1, 1]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.threshold.value -201 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.threshold.setValueAtTime value -201 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.threshold.value 1 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.threshold.setValueAtTime value 1 outside nominal range [-100, 0]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.knee.value -1 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.knee.setValueAtTime value -1 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.knee.value 81 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.knee.setValueAtTime value 81 outside nominal range [0, 40]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.ratio.value 41 outside nominal range [1, 20]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.ratio.setValueAtTime value 41 outside nominal range [1, 20]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.attack.value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.attack.setValueAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.attack.value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.attack.setValueAtTime value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.release.value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 392: DynamicsCompressor.release.setValueAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.release.value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 404: DynamicsCompressor.release.setValueAtTime value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 392: BiquadFilter.frequency.value -1 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 392: BiquadFilter.frequency.setValueAtTime value -1 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 404: BiquadFilter.frequency.value 48001 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 404: BiquadFilter.frequency.setValueAtTime value 48001 outside nominal range [0, 24000]; value will be clamped.
CONSOLE WARNING: line 392: Oscillator.frequency.value -48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 392: Oscillator.frequency.setValueAtTime value -48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 404: Oscillator.frequency.value 48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 404: Oscillator.frequency.setValueAtTime value 48001 outside nominal range [-24000, 24000]; value will be clamped.
CONSOLE WARNING: line 323: Delay.delayTime.setValueAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 324: Delay.delayTime.linearRampToValueAtTime value 2 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 325: Delay.delayTime.exponentialRampToValue value 3 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 326: Delay.delayTime.setTargetAtTime value -1 outside nominal range [0, 1]; value will be clamped.
CONSOLE WARNING: line 327: Delay.delayTime.setValueCurveAtTime value 1.5 outside nominal range [0, 1]; value will be clamped.
This is a testharness.js-based test.
PASS # AUDIT TASK RUNNER STARTED.
PASS > [initialize]
PASS Create context for tests did not throw an exception.
PASS < [initialize] All assertions passed. (total 1 assertions)
PASS > [createGain]
PASS Create offline context for tests did not throw an exception.
PASS Create online context for tests did not throw an exception.
PASS < [initialize] All assertions passed. (total 2 assertions)
PASS > [Offline createGain]
PASS GainNode.gain.minValue is equal to -3.4028234663852886e+38.
PASS GainNode.gain.maxValue is equal to 3.4028234663852886e+38.
PASS GainNode.gain.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -50,8 +52,8 @@ PASS GainNode.gain.minValue is read-only is equal to true.
PASS GainNode.gain.maxValue = Math.PI is not equal to 3.141592653589793.
PASS GainNode.gain.maxValue is read-only is equal to true.
PASS Nominal ranges for AudioParam(s) of GainNode are correct
PASS < [createGain] All assertions passed. (total 7 assertions)
PASS > [createDelay]
PASS < [Offline createGain] All assertions passed. (total 7 assertions)
PASS > [Offline createDelay]
PASS DelayNode.delayTime.minValue is equal to 0.
PASS DelayNode.delayTime.maxValue is equal to 1.5.
PASS DelayNode.delayTime.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -62,8 +64,8 @@ PASS Set DelayNode.delayTime.value = -1 is equal to 0.
PASS Set DelayNode.delayTime.value = 4 is equal to 1.5.
PASS DelayNode.delayTimewas clipped to lie within the nominal range is equal to true.
PASS Nominal ranges for AudioParam(s) of DelayNode are correct
PASS < [createDelay] All assertions passed. (total 10 assertions)
PASS > [createBufferSource]
PASS < [Offline createDelay] All assertions passed. (total 10 assertions)
PASS > [Offline createBufferSource]
PASS AudioBufferSourceNode.playbackRate.minValue is equal to -3.4028234663852886e+38.
PASS AudioBufferSourceNode.playbackRate.maxValue is equal to 3.4028234663852886e+38.
PASS AudioBufferSourceNode.playbackRate.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -77,8 +79,8 @@ PASS AudioBufferSourceNode.detune.minValue is read-only is equal to true.
PASS AudioBufferSourceNode.detune.maxValue = Math.PI is not equal to 3.141592653589793.
PASS AudioBufferSourceNode.detune.maxValue is read-only is equal to true.
PASS Nominal ranges for AudioParam(s) of AudioBufferSourceNode are correct
PASS < [createBufferSource] All assertions passed. (total 13 assertions)
PASS > [createStereoPanner]
PASS < [Offline createBufferSource] All assertions passed. (total 13 assertions)
PASS > [Offline createStereoPanner]
PASS StereoPannerNode.pan.minValue is equal to -1.
PASS StereoPannerNode.pan.maxValue is equal to 1.
PASS StereoPannerNode.pan.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -89,8 +91,8 @@ PASS Set StereoPannerNode.pan.value = -3 is equal to -1.
PASS Set StereoPannerNode.pan.value = 3 is equal to 1.
PASS StereoPannerNode.panwas clipped to lie within the nominal range is equal to true.
PASS Nominal ranges for AudioParam(s) of StereoPannerNode are correct
PASS < [createStereoPanner] All assertions passed. (total 10 assertions)
PASS > [createDynamicsCompressor]
PASS < [Offline createStereoPanner] All assertions passed. (total 10 assertions)
PASS > [Offline createDynamicsCompressor]
PASS DynamicsCompressorNode.threshold.minValue is equal to -100.
PASS DynamicsCompressorNode.threshold.maxValue is equal to 0.
PASS DynamicsCompressorNode.threshold.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -137,8 +139,8 @@ PASS Set DynamicsCompressorNode.release.value = -1 is equal to 0.
PASS Set DynamicsCompressorNode.release.value = 3 is equal to 1.
PASS DynamicsCompressorNode.releasewas clipped to lie within the nominal range is equal to true.
PASS Nominal ranges for AudioParam(s) of DynamicsCompressorNode are correct
PASS < [createDynamicsCompressor] All assertions passed. (total 46 assertions)
PASS > [createBiquadFilter]
PASS < [Offline createDynamicsCompressor] All assertions passed. (total 46 assertions)
PASS > [Offline createBiquadFilter]
PASS BiquadFilterNode.frequency.minValue is equal to 0.
PASS BiquadFilterNode.frequency.maxValue is equal to 24000.
PASS BiquadFilterNode.frequency.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -167,8 +169,8 @@ PASS BiquadFilterNode.gain.minValue is read-only is equal to true.
PASS BiquadFilterNode.gain.maxValue = Math.PI is not equal to 3.141592653589793.
PASS BiquadFilterNode.gain.maxValue is read-only is equal to true.
PASS Nominal ranges for AudioParam(s) of BiquadFilterNode are correct
PASS < [createBiquadFilter] All assertions passed. (total 28 assertions)
PASS > [createOscillator]
PASS < [Offline createBiquadFilter] All assertions passed. (total 28 assertions)
PASS > [Offline createOscillator]
PASS OscillatorNode.frequency.minValue is equal to -24000.
PASS OscillatorNode.frequency.maxValue is equal to 24000.
PASS OscillatorNode.frequency.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -185,8 +187,8 @@ PASS OscillatorNode.detune.minValue is read-only is equal to true.
PASS OscillatorNode.detune.maxValue = Math.PI is not equal to 3.141592653589793.
PASS OscillatorNode.detune.maxValue is read-only is equal to true.
PASS Nominal ranges for AudioParam(s) of OscillatorNode are correct
PASS < [createOscillator] All assertions passed. (total 16 assertions)
PASS > [createPanner]
PASS < [Offline createOscillator] All assertions passed. (total 16 assertions)
PASS > [Offline createPanner]
PASS PannerNode.positionX.minValue is equal to -3.4028234663852886e+38.
PASS PannerNode.positionX.maxValue is equal to 3.4028234663852886e+38.
PASS PannerNode.positionX.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -224,8 +226,8 @@ PASS PannerNode.orientationZ.minValue is read-only is equal to true.
PASS PannerNode.orientationZ.maxValue = Math.PI is not equal to 3.141592653589793.
PASS PannerNode.orientationZ.maxValue is read-only is equal to true.
PASS Nominal ranges for AudioParam(s) of PannerNode are correct
PASS < [createPanner] All assertions passed. (total 37 assertions)
PASS > [createConstantSource]
PASS < [Offline createPanner] All assertions passed. (total 37 assertions)
PASS > [Offline createConstantSource]
PASS ConstantSourceNode.offset.minValue is equal to -3.4028234663852886e+38.
PASS ConstantSourceNode.offset.maxValue is equal to 3.4028234663852886e+38.
PASS ConstantSourceNode.offset.minValue = Math.PI is not equal to 3.141592653589793.
......@@ -233,40 +235,40 @@ PASS ConstantSourceNode.offset.minValue is read-only is equal to true.
PASS ConstantSourceNode.offset.maxValue = Math.PI is not equal to 3.141592653589793.
PASS ConstantSourceNode.offset.maxValue is read-only is equal to true.
PASS Nominal ranges for AudioParam(s) of ConstantSourceNode are correct
PASS < [createConstantSource] All assertions passed. (total 7 assertions)
PASS > [createBuffer]
PASS < [Offline createConstantSource] All assertions passed. (total 7 assertions)
PASS > [Offline createBuffer]
PASS AudioBuffer has no AudioParams as expected
PASS < [createBuffer] All assertions passed. (total 1 assertions)
PASS > [createIIRFilter]
PASS < [Offline createBuffer] All assertions passed. (total 1 assertions)
PASS > [Offline createIIRFilter]
PASS IIRFilterNode has no AudioParams as expected
PASS < [createIIRFilter] All assertions passed. (total 1 assertions)
PASS > [createWaveShaper]
PASS < [Offline createIIRFilter] All assertions passed. (total 1 assertions)
PASS > [Offline createWaveShaper]
PASS WaveShaperNode has no AudioParams as expected
PASS < [createWaveShaper] All assertions passed. (total 1 assertions)
PASS > [createConvolver]
PASS < [Offline createWaveShaper] All assertions passed. (total 1 assertions)
PASS > [Offline createConvolver]
PASS ConvolverNode has no AudioParams as expected
PASS < [createConvolver] All assertions passed. (total 1 assertions)
PASS > [createAnalyser]
PASS < [Offline createConvolver] All assertions passed. (total 1 assertions)
PASS > [Offline createAnalyser]
PASS AnalyserNode has no AudioParams as expected
PASS < [createAnalyser] All assertions passed. (total 1 assertions)
PASS > [createScriptProcessor]
PASS < [Offline createAnalyser] All assertions passed. (total 1 assertions)
PASS > [Offline createScriptProcessor]
PASS ScriptProcessorNode has no AudioParams as expected
PASS < [createScriptProcessor] All assertions passed. (total 1 assertions)
PASS > [createPeriodicWave]
PASS < [Offline createScriptProcessor] All assertions passed. (total 1 assertions)
PASS > [Offline createPeriodicWave]
PASS PeriodicWave has no AudioParams as expected
PASS < [createPeriodicWave] All assertions passed. (total 1 assertions)
PASS > [createChannelSplitter]
PASS < [Offline createPeriodicWave] All assertions passed. (total 1 assertions)
PASS > [Offline createChannelSplitter]
PASS ChannelSplitterNode has no AudioParams as expected
PASS < [createChannelSplitter] All assertions passed. (total 1 assertions)
PASS > [createChannelMerger]
PASS < [Offline createChannelSplitter] All assertions passed. (total 1 assertions)
PASS > [Offline createChannelMerger]
PASS ChannelMergerNode has no AudioParams as expected
PASS < [createChannelMerger] All assertions passed. (total 1 assertions)
PASS > [createMediaElementSource]
PASS < [Offline createChannelMerger] All assertions passed. (total 1 assertions)
PASS > [Online createMediaElementSource]
PASS MediaElementAudioSourceNode has no AudioParams as expected
PASS < [createMediaElementSource] All assertions passed. (total 1 assertions)
PASS > [createMediaStreamDestination]
PASS < [Online createMediaElementSource] All assertions passed. (total 1 assertions)
PASS > [Online createMediaStreamDestination]
PASS MediaStreamAudioDestinationNode has no AudioParams as expected
PASS < [createMediaStreamDestination] All assertions passed. (total 1 assertions)
PASS < [Online createMediaStreamDestination] All assertions passed. (total 1 assertions)
PASS > [AudioListener]
PASS AudioListener.positionX.minValue is equal to -3.4028234663852886e+38.
PASS AudioListener.positionX.maxValue is equal to 3.4028234663852886e+38.
......
......@@ -14,8 +14,9 @@
// Some arbitrary sample rate for the offline context.
let sampleRate = 48000;
// The actual offline context
let context;
// The actual contexts to use
let offlineContext;
let onlineContext;
// The set of all methods that we've tested for verifying that we tested
// all of the necessary objects.
......@@ -31,8 +32,11 @@
let audit = Audit.createTaskRunner();
// Array describing the tests that should be run.
let testConfigs = [
// Array describing the tests that should be run. |testOfflineConfigs| is
// for tests that can use an offline context. |testOnlineConfigs| is for
// tests that need to use an online context. Offline contexts are
// preferred when possible.
let testOfflineConfigs = [
{
// The name of the method to create the particular node to be tested.
creator: 'createGain',
......@@ -186,27 +190,44 @@
creator: 'createChannelMerger',
args: [],
},
];
let testOnlineConfigs = [
{creator: 'createMediaElementSource', args: [new Audio()]},
{creator: 'createMediaStreamDestination', args: []}
// Can't currently test MediaStreamSource because we're using an offline
// context.
];
// Create the context so we can use it in the following test.
// Create the contexts so we can use it in the following test.
audit.define('initialize', (task, should) => {
// Just any context so that we can create the nodes.
should(() => {
context = new OfflineAudioContext(1, 1, sampleRate);
}, 'Create context for tests').notThrow();
offlineContext = new OfflineAudioContext(1, 1, sampleRate);
}, 'Create offline context for tests').notThrow();
should(() => {
onlineContext = new AudioContext();
}, 'Create online context for tests').notThrow();
task.done();
});
// Create a task for each entry in testConfigs
for (let test in testConfigs) {
let config = testConfigs[test]
audit.define(config.creator, (function(c) {
// Create a task for each entry in testOfflineConfigs
for (let test in testOfflineConfigs) {
let config = testOfflineConfigs[test]
audit.define('Offline ' + config.creator, (function(c) {
return (task, should) => {
let node = offlineContext[c.creator](...c.args);
testLimits(should, c.creator, node, c.limits);
task.done();
};
})(config));
}
for (let test in testOnlineConfigs) {
let config = testOnlineConfigs[test]
audit.define('Online ' + config.creator, (function(c) {
return (task, should) => {
let node = context[c.creator](...c.args);
let node = onlineContext[c.creator](...c.args);
testLimits(should, c.creator, node, c.limits);
task.done();
};
......@@ -215,7 +236,7 @@
// Test the AudioListener params that were added for the automated Panner
audit.define('AudioListener', (task, should) => {
testLimits(should, '', context.listener, {
testLimits(should, '', offlineContext.listener, {
positionX: {
minValue: -mostPositiveFloat,
maxValue: mostPositiveFloat,
......@@ -261,8 +282,8 @@
audit.define('verifyTests', (task, should) => {
let allNodes = new Set();
// Create the set of all "create" methods from the context.
for (let method in context) {
if (typeof context[method] === 'function' &&
for (let method in offlineContext) {
if (typeof offlineContext[method] === 'function' &&
method.substring(0, 6) === 'create') {
allNodes.add(method);
}
......@@ -295,7 +316,7 @@
// Just use a DelayNode for testing because the audio param has finite
// limits.
should(() => {
let d = context.createDelay();
let d = offlineContext.createDelay();
// The console output should have the warnings that we're interested
// in.
......
CONSOLE WARNING: line 22: The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
Tests garbage collection of MediaElementAudioSourceNode.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
......@@ -19,7 +19,7 @@
}
audioElement = document.createElement('audio');
context = new OfflineAudioContext(1, 1000, 44100);
context = new AudioContext();
source = context.createMediaElementSource(audioElement);
audioElement = null;
context = null;
......
......@@ -1939,6 +1939,9 @@ enum WebFeature {
kTextToSpeech_SpeakCrossOrigin = 2472,
kTextToSpeech_SpeakDisallowedByAutoplay = 2473,
kStaleWhileRevalidateEnabled = 2474,
kMediaElementSourceOnOfflineContext = 2475,
kMediaStreamDestinationOnOfflineContext = 2476,
kMediaStreamSourceOnOfflineContext = 2477,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
......
......@@ -567,6 +567,25 @@ DeprecationInfo GetDeprecationInfo(WebFeature feature) {
WillBeRemoved("Anonymous named getter of HTMLFrameSetElement",
kM70, "5235521668251648")};
case WebFeature::kMediaElementSourceOnOfflineContext:
return {"MediaElementAudioSourceNode", kM70,
WillBeRemoved("Creating a MediaElementAudioSourceNode on an "
"OfflineAudioContext",
kM70, "5258622686724096")};
case WebFeature::kMediaStreamDestinationOnOfflineContext:
return {"MediaStreamAudioDestinationNode", kM70,
WillBeRemoved("Creating a MediaStreamAudioDestinationNode on an "
"OfflineAudioContext",
kM70, "5258622686724096")};
case WebFeature::kMediaStreamSourceOnOfflineContext:
return {
"MediaStreamAudioSourceNode", kM70,
WillBeRemoved(
"Creating a MediaStreamAudioSourceNode on an OfflineAudioContext",
kM70, "5258622686724096")};
// Features that aren't deprecated don't have a deprecation message.
default:
return {"NotDeprecated", kUnknown, ""};
......
......@@ -26,6 +26,7 @@
#include "third_party/blink/renderer/modules/webaudio/media_element_audio_source_node.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/core/frame/deprecation.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/modules/webaudio/audio_node_output.h"
......@@ -249,6 +250,11 @@ MediaElementAudioSourceNode* MediaElementAudioSourceNode::Create(
media_element.SetAudioSourceNode(node);
// context keeps reference until node is disconnected
context.NotifySourceNodeStartedProcessing(node);
if (!context.HasRealtimeConstraint()) {
Deprecation::CountDeprecation(
node->GetExecutionContext(),
WebFeature::kMediaElementSourceOnOfflineContext);
}
}
return node;
......
......@@ -26,6 +26,7 @@
#include "third_party/blink/renderer/modules/webaudio/media_stream_audio_destination_node.h"
#include "third_party/blink/public/platform/web_rtc_peer_connection_handler.h"
#include "third_party/blink/renderer/core/frame/deprecation.h"
#include "third_party/blink/renderer/modules/webaudio/audio_node_input.h"
#include "third_party/blink/renderer/modules/webaudio/audio_node_options.h"
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
......@@ -181,6 +182,12 @@ MediaStreamAudioDestinationNode* MediaStreamAudioDestinationNode::Create(
node->HandleChannelOptions(options, exception_state);
if (!context->HasRealtimeConstraint()) {
Deprecation::CountDeprecation(
node->GetExecutionContext(),
WebFeature::kMediaStreamDestinationOnOfflineContext);
}
return node;
}
......
......@@ -26,6 +26,7 @@
#include "third_party/blink/renderer/modules/webaudio/media_stream_audio_source_node.h"
#include <memory>
#include "third_party/blink/renderer/core/frame/deprecation.h"
#include "third_party/blink/renderer/modules/webaudio/audio_node_output.h"
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
#include "third_party/blink/renderer/modules/webaudio/media_stream_audio_source_options.h"
......@@ -165,6 +166,12 @@ MediaStreamAudioSourceNode* MediaStreamAudioSourceNode::Create(
// context keeps reference until node is disconnected
context.NotifySourceNodeStartedProcessing(node);
if (!context.HasRealtimeConstraint()) {
Deprecation::CountDeprecation(
node->GetExecutionContext(),
WebFeature::kMediaStreamSourceOnOfflineContext);
}
return node;
}
......
......@@ -19006,6 +19006,9 @@ Called by update_net_error_codes.py.-->
<int value="2472" label="TextToSpeech_SpeakCrossOrigin"/>
<int value="2473" label="TextToSpeech_SpeakDisallowedByAutoplay"/>
<int value="2474" label="StaleWhileRevalidateEnabled"/>
<int value="2475" label="MediaElementSourceOnOfflineContext"/>
<int value="2476" label="MediaStreamDestinationOnOfflineContext"/>
<int value="2477" label="MediaStreamSourceOnOfflineContext"/>
</enum>
<enum name="FeedbackSource">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment