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

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

Issue 2386303002: Expose BaseAudioContext prototype (Closed)
Patch Set: Rebase Created 4 years, 1 month 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..1b1594a977213645670e94b84372e501463ff67d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/resources/context-properties.js
@@ -0,0 +1,81 @@
+// The list of the 'own' properties in various AudioContexts.
+// https://webaudio.github.io/web-audio-api/#BaseAudioContext
+
+
+let BaseAudioContextOwnProperties = [
+ 'createAnalyser',
+ 'createBiquadFilter',
+ 'createBuffer',
+ 'createBufferSource',
+ 'createChannelMerger',
+ 'createChannelSplitter',
+ 'createConvolver',
+ 'createDelay',
+ 'createDynamicsCompressor',
+ 'createGain',
+ 'createIIRFilter',
+ 'createOscillator',
+ 'createPanner',
+ 'createPeriodicWave',
+ 'createScriptProcessor',
+ 'createStereoPanner',
+ 'createWaveShaper',
+ 'currentTime',
+ 'decodeAudioData',
+ 'destination',
+ 'listener',
+ 'onstatechange',
+ 'resume',
+ 'sampleRate',
+ 'state',
+ 'suspend',
+
+ // TODO(hongchan): Not implemented yet.
+ // 'baseLatency',
+ // 'createConstantSource'
Raymond Toy 2016/11/02 22:10:09 This should be available now. Also, I think that
hongchan 2016/11/02 22:46:50 Done.
+];
+
+
+let AudioContextOwnProperties = [
+ 'close',
+
+ // TODO(hongchan): Not implemented yet.
+ // 'outputLatency',
+ // 'getOutputTimestamp',
+
+ // TODO(hongchan): These currently belong to BaseAudioContext.
+ // 'createMediaElementSource',
+ // 'createMediaStreamSource',
+ // 'createMediaStreamDestination',
+];
+
+
+let OfflineAudioContextOwnProperties = [
+ 'length',
+ 'oncomplete',
+ 'startRendering',
+
+ // TODO(hongchan): OAC's suspend is different from the BAC but the interface
Raymond Toy 2016/11/02 22:10:09 "BAC"?
hongchan 2016/11/02 22:46:50 BaseAudioContext.
Raymond Toy 2016/11/02 23:01:07 Let's not use abbreviations.
+ // name is identical. So we have to leave this one out of the batch
+ // comparison.
+ // 'suspend',
+];
+
+
+/**
+ * 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 {Boolean} config.expected Expected test result.
+ * @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(config.expected);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698