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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Test MediaStreamAudioSourceNode's with different URLs.
2 //
3 var context = 0;
4 var lengthInSeconds = 1;
5 var sampleRate = 44100;
6 var source = 0;
7 var audio = 0;
8
9 // Create an MediaElementSource node with the given |url| and connect it to weba udio.
10 // |oncomplete| is given the completion event to check the result.
11 function runTest (url, oncomplete, tester)
12 {
13 if (window.testRunner) {
14 testRunner.dumpAsText();
15 testRunner.waitUntilDone();
16 }
17
18 window.jsTestIsAsync = true;
19
20 context = new OfflineAudioContext(1, sampleRate * lengthInSeconds, sampleRat e);
21
22 audio = document.createElement('audio');
23
24 if (tester) {
25 tester();
26 } else {
27 audio.src = url;
28 }
29
30 source = context.createMediaElementSource(audio);
31 source.connect(context.destination);
32
33 audio.addEventListener("playing", function(e) {
34 context.startRendering();
35 });
36
37 context.oncomplete = function(e) {
38 checkResult(e);
39 finishJSTest();
40 }
41
42 audio.play();
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698