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

Unified Diff: LayoutTests/http/tests/security/resources/webaudio/media-element-audio-source-node-test.js

Issue 520433002: Output silence if the MediaElementAudioSourceNode has a different origin (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 5 years, 10 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: LayoutTests/http/tests/security/resources/webaudio/media-element-audio-source-node-test.js
diff --git a/LayoutTests/http/tests/security/resources/webaudio/media-element-audio-source-node-test.js b/LayoutTests/http/tests/security/resources/webaudio/media-element-audio-source-node-test.js
new file mode 100644
index 0000000000000000000000000000000000000000..f32b3495bba19aa3ce23c05c523382b263f72d13
--- /dev/null
+++ b/LayoutTests/http/tests/security/resources/webaudio/media-element-audio-source-node-test.js
@@ -0,0 +1,43 @@
+// Test MediaStreamAudioSourceNode's with different URLs.
+//
+var context = 0;
+var lengthInSeconds = 1;
+var sampleRate = 44100;
+var source = 0;
+var audio = 0;
+
+// Create an MediaElementSource node with the given |url| and connect it to webaudio.
+// |oncomplete| is given the completion event to check the result.
+function runTest (url, oncomplete, tester)
+{
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ window.jsTestIsAsync = true;
+
+ context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRate);
+
+ audio = document.createElement('audio');
+
+ if (tester) {
+ tester();
+ } else {
+ audio.src = url;
+ }
+
+ source = context.createMediaElementSource(audio);
+ source.connect(context.destination);
+
+ audio.addEventListener("playing", function(e) {
+ context.startRendering();
+ });
+
+ context.oncomplete = function(e) {
+ checkResult(e);
+ finishJSTest();
+ }
+
+ audio.play();
+}

Powered by Google App Engine
This is Rietveld 408576698