Bug 1493779 - Add a test for ConvolverNode with very large buffer. r=karlt
☠☠ backed out by d9f492389275 ☠ ☠
authorPaul Adenot <paul@paul.cx>
Thu, 04 Oct 2018 15:31:47 +0000
changeset 495363 53950ea4b1055b291c417948cc685f044fef97aa
parent 495362 a9d0b65595c1cfd92c7e78747244066e6bbf4d47
child 495364 e78d9996b1a44045dcf8a85722189a3db77033d3
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs1493779
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,41 @@
+<!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,
+  skipOfflineContextTests: true,
+  createGraph: function(context) {
+    var source = context.createOscillator();
+    var convolver = context.createConvolver();
+    // Very big buffer that results in an OOM
+    try {
+      var buffer = context.createBuffer(2, 300000000, context.sampleRate)
+    } catch(e) {
+      // OOM when attempting to create the buffer, this can happen on 32bits
+      // OSes. Simply return here.
+      return convolver;
+    }
+    var channel = buffer.getChannelData(0);
+    source.connect(convolver);
+    convolver.buffer = buffer;
+    source.start();
+    return convolver;
+  }
+};
+
+runTest();
+
+</script>
+</pre>
+</body>
+</html>