diff options
author | Matt A. Tobin <email@mattatobin.com> | 2016-10-16 19:34:53 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2016-10-16 19:34:53 -0400 |
commit | 81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch) | |
tree | 6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/webaudioeditor/test/browser_audionode-actor-is-source.js | |
parent | 28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff) | |
download | palemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz |
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/webaudioeditor/test/browser_audionode-actor-is-source.js')
-rw-r--r-- | toolkit/devtools/webaudioeditor/test/browser_audionode-actor-is-source.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/toolkit/devtools/webaudioeditor/test/browser_audionode-actor-is-source.js b/toolkit/devtools/webaudioeditor/test/browser_audionode-actor-is-source.js new file mode 100644 index 000000000..13523fb36 --- /dev/null +++ b/toolkit/devtools/webaudioeditor/test/browser_audionode-actor-is-source.js @@ -0,0 +1,27 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/** + * Test AudioNode#isSource() + */ + +add_task(function*() { + let { target, front } = yield initBackend(SIMPLE_NODES_URL); + let [_, nodes] = yield Promise.all([ + front.setup({ reload: true }), + getN(front, "create-node", 14) + ]); + + let actualTypes = yield Promise.all(nodes.map(node => node.getType())); + let isSourceResult = yield Promise.all(nodes.map(node => node.isSource())); + + actualTypes.forEach((type, i) => { + let shouldBeSource = type === "AudioBufferSourceNode" || type === "OscillatorNode"; + if (shouldBeSource) + is(isSourceResult[i], true, type + "'s isSource() yields into `true`"); + else + is(isSourceResult[i], false, type + "'s isSource() yields into `false`"); + }); + + yield removeTab(target.tab); +}); |