Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(951)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js

Issue 2386303002: Expose BaseAudioContext prototype (Closed)
Patch Set: Removes old context property test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698