Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js b/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..850b75f30f5a64257a39e0f057cb511a0a3ceecd |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js |
| @@ -0,0 +1,75 @@ |
| +// The list of the 'own' properties in various AudioContexts. |
| +// https://webaudio.github.io/web-audio-api/#BaseAudioContext |
| + |
| + |
| +let BaseAudioContextOwnProperties = [ |
| + 'destination', |
|
Raymond Toy
2016/10/03 20:19:20
Should this be alphabetical? Or maybe alphabetical
hongchan
2016/10/03 20:31:19
This is the order from the enumeration by the 'in'
|
| + 'currentTime', |
| + 'sampleRate', |
| + 'listener', |
| + 'state', |
| + 'onstatechange', |
| + 'createBuffer', |
| + 'decodeAudioData', |
| + 'createBufferSource', |
| + 'createGain', |
| + 'createDelay', |
| + 'createBiquadFilter', |
| + 'createIIRFilter', |
| + 'createWaveShaper', |
| + 'createPanner', |
| + 'createConvolver', |
| + 'createDynamicsCompressor', |
| + 'createAnalyser', |
| + 'createScriptProcessor', |
| + 'createStereoPanner', |
| + 'createOscillator', |
| + 'createPeriodicWave', |
| + 'createChannelSplitter', |
| + 'createChannelMerger', |
| + 'suspend', |
| + 'resume', |
| + |
| + // Not implemented yet: |
| + // 'baseLatency', |
| + // 'createConstantSource' |
| +]; |
| + |
| + |
| +let AudioContextOwnProperties = [ |
| + 'close', |
| + |
| + // Not implemented yet: |
| + // 'outputLatency', |
| + // 'getOutputTimestamp', |
| + |
| + // These currently belong to BaseAudioContext. |
| + // 'createMediaElementSource', |
| + // 'createMediaStreamSource', |
| + // 'createMediaStreamDestination', |
| +]; |
| + |
| + |
| +let OfflineAudioContextOwnProperties = [ |
| + 'startRendering', |
| + 'suspend', |
| + 'length', |
| + 'oncomplete', |
| +]; |
| + |
| + |
| +/** |
| + * Check properties in the prototype of BaseAudioContext and its variants. |
| + * @param {Object} config Test configuration object. |
| + * @param {Object} config.targetPrototype Target prototype. |
| + * @param {String} config.targetDescription String description of the target. |
| + * @param {Array} config.propertyDict Property dictionary. |
| + */ |
| +function checkContextProperties (config, should) { |
| + for (let index in config.propertyDict) { |
| + var property = config.propertyDict[index]; |
| + should( |
| + config.targetDescription + '.hasOwnProperty("' + property + '")', |
| + config.targetPrototype.hasOwnProperty(property)).beEqualTo(true); |
| + } |
| +} |