dom/media/webaudio/test/test_convolverNodeOOM.html
author Paul Adenot <paul@paul.cx>
Tue, 02 Oct 2018 13:03:40 +0000
changeset 487960 e380ab03ba8d217da28227c7c994af5dad089cf9
permissions -rw-r--r--
Bug 1493779 - Add a test for ConvolverNode with very large buffer. r=karlt Differential Revision: https://phabricator.services.mozilla.com/D6935

<!DOCTYPE HTML>
<html>
<head>
  <title>Test ConvolverNode with very large buffer that triggers an OOM</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  <script type="text/javascript" src="webaudio.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">

var gTest = {
  length: 2048,
  numberOfChannels: 1,
  createGraph: function(context) {
    var source = context.createOscillator();
    var convolver = context.createConvolver();
    // Very big buffer that results in an OOM
    var buffer = context.createBuffer(2, 300000000, context.sampleRate)
    var channel = buffer.getChannelData(0);
    source.connect(convolver);
    convolver.buffer = buffer;
    source.start();
    return convolver;
  }
};

runTest();

</script>
</pre>
</body>
</html>