Bug 1493779 - Add a test for ConvolverNode with very large buffer. r=karlt
☠☠ backed out by ff0aee3fd2ae ☠ ☠
authorPaul Adenot <paul@paul.cx>
Tue, 02 Oct 2018 13:03:40 +0000
changeset 487960 e380ab03ba8d217da28227c7c994af5dad089cf9
parent 487959 d2da06992e462b9c44cda013f8122bc6a6412525
child 487961 cefa70540aacffeffaec04a4221c7ebfc0acceca
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewerskarlt
bugs1493779
milestone64.0a1
Bug 1493779 - Add a test for ConvolverNode with very large buffer. r=karlt Differential Revision: https://phabricator.services.mozilla.com/D6935
dom/media/webaudio/test/mochitest.ini
dom/media/webaudio/test/test_convolverNodeOOM.html
--- a/dom/media/webaudio/test/mochitest.ini
+++ b/dom/media/webaudio/test/mochitest.ini
@@ -114,16 +114,17 @@ skip-if = toolkit == 'android' # bug 105
 [test_channelSplitterNodeWithVolume.html]
 skip-if = (android_version == '18' && debug) # bug 1158417
 [test_convolverNode.html]
 [test_convolverNode_mono_mono.html]
 [test_convolverNodeChannelCount.html]
 [test_convolverNodeChannelInterpretationChanges.html]
 [test_convolverNodeDelay.html]
 [test_convolverNodeFiniteInfluence.html]
+[test_convolverNodeOOM.html]
 [test_convolverNodeNormalization.html]
 [test_convolverNodePassThrough.html]
 [test_convolverNodeWithGain.html]
 [test_convolver-upmixing-1-channel-response.html]
 # This is a copy of
 # testing/web-platform/tests/webaudio/the-audio-api/the-convolvernode-interface/convolver-upmixing-1-channel-response.html,
 # but WPT are not run with ASan or Android builds.
 skip-if = !asan && toolkit != android
new file mode 100644
--- /dev/null
+++ b/dom/media/webaudio/test/test_convolverNodeOOM.html
@@ -0,0 +1,34 @@
+<!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>