Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test AudioParam timeline events scheduled after the destination stream has started playback</title>
5 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <script type="text/javascript" src="webaudio.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8 </head>
9 <body>
10 <pre id="test">
11 <script class="testbody" type="text/javascript">
13 var gTest = {
14 length: 16384,
15 numberOfChannels: 1,
16 createGraphAsync: function(context, callback) {
17 var sourceBuffer = context.createBuffer(1, 2048, context.sampleRate);
18 for (var i = 0; i < 2048; ++i) {
19 sourceBuffer.getChannelData(0)[i] = 1;
20 }
22 setTimeout(function() {
23 var source = context.createBufferSource();
24 source.buffer = sourceBuffer;
25 source.start(context.currentTime);
26 source.stop(context.currentTime + sourceBuffer.duration);
28 var gain = context.createGain();
29 gain.gain.setValueAtTime(0, context.currentTime);
30 gain.gain.setTargetAtTime(0, context.currentTime + sourceBuffer.duration, 1);
31 source.connect(gain);
33 callback(gain);
34 }, 100);
35 },
36 };
38 runTest();
40 </script>
41 </pre>
42 </body>
43 </html>