Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html |
| index 1ed09766dae5b7955f437428471cc88bfcedaa11..4327be286b9e9b1eda9269bdc2b1f18f16cdb00f 100644 |
| --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html |
| +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions.html |
| @@ -27,24 +27,22 @@ function shouldThrowAndBeUnchanged(should, node, attr, value) { |
| should(node[attr], node.constructor.name + '.' + attr).notBeEqualTo(value); |
| } |
| -audit.define('initialize', (task, should) => { |
| - task.describe('Initialize contexts for testing'); |
| +audit.define( |
| + {label: 'initialize', description: 'Initialize contexts for testing'}, |
| + (task, should) => { |
| - should(() => { |
| - context = new AudioContext(); |
| - }, 'context = new AudioContext()').notThrow(); |
| + should(() => { |
| + context = new AudioContext(); |
| + }, 'context = new AudioContext()').notThrow(); |
| - should(() => { |
| - otherContext = new AudioContext(); }, |
| - 'otherContext = new AudioContext()') |
| - .notThrow(); |
| + should(() => { |
| + otherContext = new AudioContext(); |
| + }, 'otherContext = new AudioContext()').notThrow(); |
| - task.done(); |
| -}); |
| + task.done(); |
| + }); |
| audit.define('createBuffer', (task, should) => { |
| - task.describe('createBuffer'); |
| - |
| // Invalid number of channels: NotSupportedError |
| should( |
| () => context.createBuffer(99, 1, context.sampleRate), |
| @@ -96,8 +94,6 @@ audit.define('createBuffer', (task, should) => { |
| }); |
| audit.define('createMediaElementSource', (task, should) => { |
| - task.describe('createMediaElementSource'); |
| - |
| // Invalid sources (unspecified error) |
| should( |
| () => context.createMediaElementSource(null), |
| @@ -107,8 +103,6 @@ audit.define('createMediaElementSource', (task, should) => { |
| }); |
| audit.define('createMediaStreamSource', (task, should) => { |
| - task.describe('createMediaStreamSource'); |
| - |
| // Invalid sources (unspecified error) |
| should( |
| () => context.createMediaStreamSource(null), |
| @@ -119,8 +113,6 @@ audit.define('createMediaStreamSource', (task, should) => { |
| }); |
| audit.define('createScriptProcessor', (task, should) => { |
| - task.describe('createScriptProcessor'); |
| - |
| // Invalid buffer size: IndexSizeError |
| should( |
| () => context.createScriptProcessor(1, 1, 1), |
| @@ -147,8 +139,6 @@ audit.define('createScriptProcessor', (task, should) => { |
| }); |
| audit.define('createChannelSplitter', (task, should) => { |
| - task.describe('createChannelSplitter'); |
| - |
| // Invalid number of channels: IndexSizeError |
| should( |
| () => context.createChannelSplitter(0), |
| @@ -165,8 +155,6 @@ audit.define('createChannelSplitter', (task, should) => { |
| }); |
| audit.define('createChannelMerger', (task, should) => { |
| - task.describe('createChannelMerger'); |
| - |
| // Invalid number of channels: IndexSizeError |
| should( |
| () => context.createChannelMerger(99), 'context.createChannelMerger(99)') |
| @@ -176,8 +164,6 @@ audit.define('createChannelMerger', (task, should) => { |
| }); |
| audit.define('createPeriodicWave', (task, should) => { |
| - task.describe('createPeriodicWave'); |
| - |
| // Invalid real/imag arrays: IndexSizeError |
| should( |
| () => context.createPeriodicWave(null, null), |
| @@ -214,8 +200,6 @@ audit.define('createPeriodicWave', (task, should) => { |
| }); |
| audit.define('createAnalyser', (task, should) => { |
| - task.describe('createAnalyser'); |
| - |
| // Analysers |
| node = context.createAnalyser(); |
| // Invalid fftSize: IndexSizeError |
| @@ -237,7 +221,8 @@ audit.define('createAnalyser', (task, should) => { |
| 'AnalyserNode.getFloatFrequencyData(null)') |
| .throw(); |
| should( |
| - () => node.getByteFrequencyData(null), node.constructor.name + '.getByteFrequencyData(null)') |
| + () => node.getByteFrequencyData(null), |
| + node.constructor.name + '.getByteFrequencyData(null)') |
| .throw(); |
| should( |
| () => node.getFloatTimeDomainData(null), |
| @@ -251,84 +236,98 @@ audit.define('createAnalyser', (task, should) => { |
| // AudioBuffers |
| node = context.createBuffer(1, 1, context.sampleRate); |
| // Invalid channel index: IndexSizeError |
| - should(() => node.getChannelData(2), node.constructor.name + '.getChannelData(2)').throw(); |
| - |
| - task.done(); |
| -}); |
| - |
| -audit.define('Init test nodes', (task, should) => { |
| - task.describe('Create test nodes'); |
| - should(() => { node = context.createGain(); }, |
| - 'node = context.createGain()') |
| - .notThrow(); |
| - should(() => { node2 = context.createGain(); }, |
| - 'node2 = context.createGain()') |
| - .notThrow(); |
| - |
| - task.done(); |
| -}); |
| - |
| -audit.define('connections', (task, should) => { |
| - task.describe('AudioNode connections'); |
| - |
| - // AudioNode connections |
| - // Invalid destination node (unspecified error) |
| - should(() => node.connect(null, 0, 0), 'node.connect(null, 0, 0)').throw(); |
| - // Invalid input or output index: IndexSizeError |
| - should( |
| - () => node.connect(context.destination, 100, 0), |
| - 'node.connect(context.destination, 100, 0)') |
| - .throw('IndexSizeError'); |
| - should( |
| - () => node.connect(context.destination, 0, 100), |
| - 'node.connect(context.destination, 0, 100)') |
| - .throw('IndexSizeError'); |
| - should(() => node.connect(node2.gain, 100), 'node.connect(node2.gain, 100)') |
| - .throw('IndexSizeError'); |
| - should(() => node.disconnect(99), 'node.disconnect(99)') |
| - .throw('IndexSizeError'); |
| - // Can't connect to a different context (unspecified error) |
| should( |
| - () => node.connect(otherContext.destination), |
| - 'node.connect(otherContext.destination)') |
| + () => node.getChannelData(2), |
| + node.constructor.name + '.getChannelData(2)') |
| .throw(); |
| task.done(); |
| }); |
| -audit.define('channel-stuff', (task, should) => { |
| - task.describe('channelCount, channelCountMode, channelInterpretation'); |
| - |
| - // Invalid channel count: NotSupportedError |
| - shouldThrowAndBeUnchanged(should, node, 'channelCount', '99'); |
| - // Invalid mode or interpretation (unspecified error) |
| - currentMode = node.channelCountMode; |
| - currentInterpretation = node.channelInterpretation; |
| - should( |
| - () => node.channelCountMode = 'fancy', 'node.channelCountMode = "fancy"') |
| - .notThrow(); |
| - should(node.channelCountMode, 'node.channelCountMode').beEqualTo(currentMode); |
| - should( |
| - () => node.channelInterpretation = mode, |
| - 'node.channelInterpretation = mode') |
| - .notThrow(); |
| - should(node.channelInterpretation, 'node.channelInterpretation') |
| - .beEqualTo(currentInterpretation); |
| - // Destination node channel count: should throw IndexSizeError on invalid |
| - // channel count. shouldNotThrow() method cannot be used because the error |
| - // message includes the number of channels, which can change depending on |
| - // the actual attached hardware. |
| - should( |
| - () => context.destination.channelCount = 99, |
| - 'context.destination.channelCount = 99') |
| - .throw('IndexSizeError'); |
| - |
| - task.done(); |
| -}); |
| +audit.define( |
| + { |
| + label: 'Init test nodes', |
| + description: 'Create test nodes for the following tests' |
| + }, |
| + (task, should) => { |
| + should(() => { |
| + node = context.createGain(); |
| + }, 'node = context.createGain()').notThrow(); |
| + should(() => { |
| + node2 = context.createGain(); |
| + }, 'node2 = context.createGain()').notThrow(); |
| + |
| + task.done(); |
| + }); |
| + |
| +audit.define( |
| + {label: 'connections', description: 'AudioNode connections'}, |
| + (task, should) => { |
| + |
| + // AudioNode connections |
| + // Invalid destination node (unspecified error) |
| + should(() => node.connect(null, 0, 0), 'node.connect(null, 0, 0)') |
| + .throw(); |
| + // Invalid input or output index: IndexSizeError |
| + should( |
| + () => node.connect(context.destination, 100, 0), |
| + 'node.connect(context.destination, 100, 0)') |
| + .throw('IndexSizeError'); |
| + should( |
| + () => node.connect(context.destination, 0, 100), |
| + 'node.connect(context.destination, 0, 100)') |
| + .throw('IndexSizeError'); |
| + should( |
| + () => node.connect(node2.gain, 100), 'node.connect(node2.gain, 100)') |
| + .throw('IndexSizeError'); |
| + should(() => node.disconnect(99), 'node.disconnect(99)') |
| + .throw('IndexSizeError'); |
| + // Can't connect to a different context (unspecified error) |
| + should( |
| + () => node.connect(otherContext.destination), |
| + 'node.connect(otherContext.destination)') |
| + .throw(); |
| + |
| + task.done(); |
| + }); |
| + |
| +audit.define( |
| + { |
| + label: 'channel-stuff', |
| + description: 'channelCount, channelCountMode, channelInterpretation' |
| + }, |
| + (task, should) => { |
| + |
| + // Invalid channel count: NotSupportedError |
| + shouldThrowAndBeUnchanged(should, node, 'channelCount', '99'); |
| + // Invalid mode or interpretation (unspecified error) |
| + currentMode = node.channelCountMode; |
| + currentInterpretation = node.channelInterpretation; |
| + should( |
| + () => node.channelCountMode = 'fancy', |
| + 'node.channelCountMode = "fancy"') |
| + .notThrow(); |
| + should(node.channelCountMode, 'node.channelCountMode') |
| + .beEqualTo(currentMode); |
| + should( |
| + () => node.channelInterpretation = mode, |
| + 'node.channelInterpretation = mode') |
| + .notThrow(); |
| + should(node.channelInterpretation, 'node.channelInterpretation') |
| + .beEqualTo(currentInterpretation); |
| + // Destination node channel count: should throw IndexSizeError on invalid |
| + // channel count. shouldNotThrow() method cannot be used because the error |
| + // message includes the number of channels, which can change depending on |
| + // the actual attached hardware. |
| + should( |
| + () => context.destination.channelCount = 99, |
| + 'context.destination.channelCount = 99') |
| + .throw('IndexSizeError'); |
| + |
| + task.done(); |
| + }); |
| audit.define('audioparam', (task, should) => { |
| - task.describe('Simple AudioParam'); |
| - |
| // AudioParams |
| param = context.createGain().gain; |
| should( |
| @@ -373,8 +372,6 @@ audit.define('audioparam', (task, should) => { |
| }); |
| audit.define('biquad', (task, should) => { |
| - task.describe('BiquadFilter'); |
| - |
| // BiquadFilterNode |
| node = context.createBiquadFilter(); |
| should( |
| @@ -402,8 +399,6 @@ audit.define('biquad', (task, should) => { |
| }); |
| audit.define('offline-audio-context', (task, should) => { |
| - task.describe('OfflineAudioContext'); |
| - |
| // OfflineAudioContext |
| // Max supported channels |
| should( |
| @@ -434,8 +429,6 @@ audit.define('offline-audio-context', (task, should) => { |
| }); |
| audit.define('waveshaper', (task, should) => { |
| - task.describe('WaveShaper'); |
| - |
| // WaveShaper types |
| node = context.createWaveShaper(); |
| currentOversample = node.oversample; |
| @@ -456,149 +449,157 @@ audit.define('waveshaper', (task, should) => { |
| task.done(); |
| }); |
| -audit.define('audio-buffer-source', (task, should) => { |
| - task.describe('AudioBufferSource start/stop'); |
| - |
| - // Start/stop for AudioBufferSourceNodes |
| - buffer = context.createBuffer(1, 1, context.sampleRate); |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| - should( |
| - () => source.buffer = context.createBuffer(1, 10, context.sampleRate), |
| - 'source.buffer = context.createBuffer(1, 10, context.sampleRate)') |
| - .throw(); |
| - should(() => source.start(-1), 'source.start(-1)').throw(); |
| - should(() => source.start(Infinity), 'source.start(Infinity)').throw(); |
| - should(() => source.start(-Infinity), 'source.start(-Infinity)').throw(); |
| - should(() => source.start(NaN), 'source.start(NaN)').throw(); |
| - should(() => source.start(1, Infinity), 'source.start(1, Infinity)').throw(); |
| - should(() => source.start(1, -Infinity), 'source.start(1, -Infinity)') |
| - .throw(); |
| - should(() => source.start(1, NaN), 'source.start(1, NaN)').throw(); |
| - should(() => source.start(1, -1), 'source.start(1, -1)').throw(); |
| - should( |
| - () => source.start(1, -Number.MIN_VALUE), |
| - 'source.start(1, -Number.MIN_VALUE)') |
| - .throw(); |
| - should(() => source.start(1, 1, Infinity), 'source.start(1, 1, Infinity)') |
| - .throw(); |
| - should(() => source.start(1, 1, -Infinity), 'source.start(1, 1, -Infinity)') |
| - .throw(); |
| - should(() => source.start(1, 1, NaN), 'source.start(1, 1, NaN)').throw(); |
| - should(() => source.start(1, 1, -1), 'source.start(1, 1, -1)').throw(); |
| - should( |
| - () => source.start(1, 1, -Number.MIN_VALUE), |
| - 'source.start(1, 1, -Number.MIN_VALUE)') |
| - .throw(); |
| - should(() => source.start(), 'source.start()').notThrow(); |
| - should(() => source.stop(-Number.MIN_VALUE), 'source.stop(-Number.MIN_VALUE)') |
| - .throw(); |
| - should(() => source.stop(Infinity), 'source.stop(Infinity)').throw(); |
| - should(() => source.stop(-Infinity), 'source.stop(-Infinity)').throw(); |
| - should(() => source.stop(NaN), 'source.stop(NaN)').throw(); |
| - should(() => source.stop(), 'source.stop()').notThrow(); |
| - |
| - // Verify that start(0, 0) doesn't signal. |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| - should(() => source.start(0, 0), 'source.start(0, 0)').notThrow(); |
| - |
| - // Verify that start(0, -0.0) doesn't signal. |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| - should(() => source.start(0, -1 / Infinity), 'source.start(0, -1/Infinity)') |
| - .notThrow(); |
| - |
| - // It's not clear from the spec, but I think it's valid to call start(). The |
| - // spec is silent on |
| - // what happens if we call stop() afterwards, so don't call it. |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.start(), 'source.start()').notThrow(); |
| - |
| - buffer = context.createBuffer(1, 1, context.sampleRate); |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| - should(() => source.stop(), 'source.stop()').throw(); |
| - |
| - buffer = context.createBuffer(1, 1, context.sampleRate); |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| - should(() => source.start(), 'source.start()').notThrow(); |
| - should(() => source.start(), 'source.start()').throw(); |
| - |
| - buffer = context.createBuffer(1, 1, context.sampleRate); |
| - should( |
| - () => source = context.createBufferSource(), |
| - 'source = context.createBufferSource()') |
| - .notThrow(); |
| - should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| - should(() => source.start(), 'source.start()').notThrow(); |
| - should(() => source.stop(), 'source.stop()').notThrow(); |
| - |
| - task.done(); |
| -}); |
| - |
| -audit.define('oscillator', (task, should) => { |
| - task.describe('Oscillator start/stop'); |
| - |
| - // Start/stop for OscillatorNodes |
| - should( |
| - () => source = context.createOscillator(), |
| - 'source = context.createOscillator()') |
| - .notThrow(); |
| - should( |
| - () => source.start(-Number.MIN_VALUE), 'source.start(-Number.MIN_VALUE)') |
| - .throw(); |
| - should(() => source.start(Infinity), 'source.start(Infinity)').throw(); |
| - should(() => source.start(-Infinity), 'source.start(-Infinity)').throw(); |
| - should(() => source.start(NaN), 'source.start(NaN)').throw(); |
| - should(() => source.start(), 'source.start()').notThrow(); |
| - should(() => source.stop(-Number.MIN_VALUE), 'source.stop(-Number.MIN_VALUE)') |
| - .throw(); |
| - should(() => source.stop(Infinity), 'source.stop(Infinity)').throw(); |
| - should(() => source.stop(-Infinity), 'source.stop(-Infinity)').throw(); |
| - should(() => source.stop(NaN), 'source.stop(NaN)').throw(); |
| - should(() => source.stop(), 'source.stop()').notThrow(); |
| - |
| - should( |
| - () => osc = context.createOscillator(), |
| - 'osc = context.createOscillator()') |
| - .notThrow(); |
| - should(() => osc.stop(), 'osc.stop()').throw(); |
| - should( |
| - () => osc1 = context.createOscillator(), |
| - 'osc1 = context.createOscillator()') |
| - .notThrow(); |
| - should(() => osc1.start(), 'osc1.start()').notThrow(); |
| - should(() => osc1.stop(), 'osc1.stop()').notThrow(); |
| - |
| - should(() => osc.setPeriodicWave(null), 'osc.setPeriodicWave(null)').throw(); |
| - |
| - |
| - task.done(); |
| -}); |
| +audit.define( |
| + {label: 'audio-buffer-source', description: 'AudioBufferSource start/stop'}, |
| + (task, should) => { |
| + |
| + // Start/stop for AudioBufferSourceNodes |
| + buffer = context.createBuffer(1, 1, context.sampleRate); |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| + should( |
| + () => source.buffer = context.createBuffer(1, 10, context.sampleRate), |
| + 'source.buffer = context.createBuffer(1, 10, context.sampleRate)') |
| + .throw(); |
| + should(() => source.start(-1), 'source.start(-1)').throw(); |
| + should(() => source.start(Infinity), 'source.start(Infinity)').throw(); |
| + should(() => source.start(-Infinity), 'source.start(-Infinity)').throw(); |
| + should(() => source.start(NaN), 'source.start(NaN)').throw(); |
| + should(() => source.start(1, Infinity), 'source.start(1, Infinity)') |
| + .throw(); |
| + should(() => source.start(1, -Infinity), 'source.start(1, -Infinity)') |
| + .throw(); |
| + should(() => source.start(1, NaN), 'source.start(1, NaN)').throw(); |
| + should(() => source.start(1, -1), 'source.start(1, -1)').throw(); |
| + should( |
| + () => source.start(1, -Number.MIN_VALUE), |
| + 'source.start(1, -Number.MIN_VALUE)') |
| + .throw(); |
| + should(() => source.start(1, 1, Infinity), 'source.start(1, 1, Infinity)') |
| + .throw(); |
| + should( |
| + () => source.start(1, 1, -Infinity), 'source.start(1, 1, -Infinity)') |
| + .throw(); |
| + should(() => source.start(1, 1, NaN), 'source.start(1, 1, NaN)').throw(); |
| + should(() => source.start(1, 1, -1), 'source.start(1, 1, -1)').throw(); |
| + should( |
| + () => source.start(1, 1, -Number.MIN_VALUE), |
| + 'source.start(1, 1, -Number.MIN_VALUE)') |
| + .throw(); |
| + should(() => source.start(), 'source.start()').notThrow(); |
| + should( |
| + () => source.stop(-Number.MIN_VALUE), |
| + 'source.stop(-Number.MIN_VALUE)') |
| + .throw(); |
| + should(() => source.stop(Infinity), 'source.stop(Infinity)').throw(); |
| + should(() => source.stop(-Infinity), 'source.stop(-Infinity)').throw(); |
| + should(() => source.stop(NaN), 'source.stop(NaN)').throw(); |
| + should(() => source.stop(), 'source.stop()').notThrow(); |
| + |
| + // Verify that start(0, 0) doesn't signal. |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| + should(() => source.start(0, 0), 'source.start(0, 0)').notThrow(); |
| + |
| + // Verify that start(0, -0.0) doesn't signal. |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| + should( |
| + () => source.start(0, -1 / Infinity), 'source.start(0, -1/Infinity)') |
| + .notThrow(); |
| + |
| + // It's not clear from the spec, but I think it's valid to call start(). |
| + // The spec is silent on what happens if we call stop() afterwards, so |
| + // don't call it. |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.start(), 'source.start()').notThrow(); |
| + |
| + buffer = context.createBuffer(1, 1, context.sampleRate); |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| + should(() => source.stop(), 'source.stop()').throw(); |
| + |
| + buffer = context.createBuffer(1, 1, context.sampleRate); |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| + should(() => source.start(), 'source.start()').notThrow(); |
| + should(() => source.start(), 'source.start()').throw(); |
| + |
| + buffer = context.createBuffer(1, 1, context.sampleRate); |
| + should( |
| + () => source = context.createBufferSource(), |
| + 'source = context.createBufferSource()') |
| + .notThrow(); |
| + should(() => source.buffer = buffer, 'source.buffer = buffer').notThrow(); |
| + should(() => source.start(), 'source.start()').notThrow(); |
| + should(() => source.stop(), 'source.stop()').notThrow(); |
| + |
| + task.done(); |
| + }); |
| + |
| +audit.define( |
| + {label: 'oscillator', description: 'start/stop'}, (task, should) => { |
| + |
| + // Start/stop for OscillatorNodes |
| + should( |
| + () => source = context.createOscillator(), |
| + 'source = context.createOscillator()') |
| + .notThrow(); |
| + should( |
| + () => source.start(-Number.MIN_VALUE), |
| + 'source.start(-Number.MIN_VALUE)') |
| + .throw(); |
| + should(() => source.start(Infinity), 'source.start(Infinity)').throw(); |
| + should(() => source.start(-Infinity), 'source.start(-Infinity)').throw(); |
| + should(() => source.start(NaN), 'source.start(NaN)').throw(); |
| + should(() => source.start(), 'source.start()').notThrow(); |
| + should( |
| + () => source.stop(-Number.MIN_VALUE), |
| + 'source.stop(-Number.MIN_VALUE)') |
| + .throw(); |
| + should(() => source.stop(Infinity), 'source.stop(Infinity)').throw(); |
| + should(() => source.stop(-Infinity), 'source.stop(-Infinity)').throw(); |
| + should(() => source.stop(NaN), 'source.stop(NaN)').throw(); |
| + should(() => source.stop(), 'source.stop()').notThrow(); |
| + |
| + should( |
| + () => osc = context.createOscillator(), |
| + 'osc = context.createOscillator()') |
| + .notThrow(); |
| + should(() => osc.stop(), 'osc.stop()').throw(); |
| + should( |
| + () => osc1 = context.createOscillator(), |
| + 'osc1 = context.createOscillator()') |
| + .notThrow(); |
| + should(() => osc1.start(), 'osc1.start()').notThrow(); |
| + should(() => osc1.stop(), 'osc1.stop()').notThrow(); |
| + |
| + should(() => osc.setPeriodicWave(null), 'osc.setPeriodicWave(null)') |
| + .throw(); |
| + |
| + |
| + task.done(); |
| + }); |
| audit.define('convolver', (task, should) => { |
|
hongchan
2017/03/03 15:52:21
Are we fine with no description?
|
| - task.describe('Convolver'); |
| - |
| // Convolver buffer rate must match context rate. Create on offline context so |
| // we |
| // specify the context rate exactly, in case the test is run on platforms with |
| @@ -622,8 +623,6 @@ audit.define('convolver', (task, should) => { |
| }); |
| audit.define('panner', (task, should) => { |
|
hongchan
2017/03/03 15:52:21
And here too?
Raymond Toy
2017/03/03 18:38:04
While there is a task.describe, it basically added
|
| - task.describe('Panner'); |
| - |
| // PannerNode channel count and mode |
| panner = context.createPanner(); |
| // Channel count can only be set to 1 or 2. |
| @@ -650,8 +649,6 @@ audit.define('panner', (task, should) => { |
| }); |
| audit.define('script-processor', (task, should) => { |
|
hongchan
2017/03/03 15:52:21
Ditto.
|
| - task.describe('ScriptProcessor'); |
| - |
| // Test channel count and mode for a ScriptProcessor. |
| should( |
| () => script = context.createScriptProcessor(256, 3), |
| @@ -680,17 +677,17 @@ audit.define('script-processor', (task, should) => { |
| task.done(); |
| }); |
| -audit.define('misc', (task, should) => { |
| - task.describe('Miscellaneous'); |
| +audit.define( |
| + {label: 'misc', description: 'Miscellaneous tests'}, (task, should) => { |
| - // noteOn and noteOff don't exist anymore |
| - should(osc.noteOn, 'osc.noteOn').beEqualTo(undefined); |
| - should(osc.noteOff, 'osc.noteOff').beEqualTo(undefined); |
| - should(source.noteOn, 'source.noteOn').beEqualTo(undefined); |
| - should(source.noteOff, 'source.noteOff').beEqualTo(undefined); |
| + // noteOn and noteOff don't exist anymore |
| + should(osc.noteOn, 'osc.noteOn').beEqualTo(undefined); |
| + should(osc.noteOff, 'osc.noteOff').beEqualTo(undefined); |
| + should(source.noteOn, 'source.noteOn').beEqualTo(undefined); |
| + should(source.noteOff, 'source.noteOff').beEqualTo(undefined); |
| - task.done(); |
| -}); |
| + task.done(); |
| + }); |
| audit.run(); |
| </script> |