Bug 1355898 - Add crashtest. a=gchang
authorTimothy Nikkel <tnikkel@gmail.com>
Thu, 13 Apr 2017 19:56:24 -0500
changeset 395940 9edc76120a27a6c407e9f45d0b7a9b0877b80f57
parent 395939 2763894710d88fa05a326ea2a8f35a947c2f60e8
child 395941 22a981da392681c112d4dd72e4ce7d042905a1f5
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgchang
bugs1355898
milestone54.0
Bug 1355898 - Add crashtest. a=gchang
image/test/crashtests/1355898-1.html
image/test/crashtests/crashtests.list
new file mode 100644
--- /dev/null
+++ b/image/test/crashtests/1355898-1.html
@@ -0,0 +1,45 @@
+<!doctype html>
+<html>
+  <head>
+    <script>
+// Test that texImage2D on an animated image doesn't assert.
+
+var gl;
+
+function start() {
+  canvas = document.getElementById("glcanvas");
+  gl = null;
+
+  try {
+    gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
+  }
+  catch(e) {
+  }
+
+  if (!gl) {
+    return;
+  }
+
+  var texture = gl.createTexture();
+  var image = new Image();
+  image.onload = function() { handleTextureLoaded(image, texture); }
+  image.src = "1249576-1.png"; // an animated png
+}
+
+function handleTextureLoaded(image, texture) {
+  gl.bindTexture(gl.TEXTURE_2D, texture);
+  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
+  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST);
+  gl.generateMipmap(gl.TEXTURE_2D);
+  gl.bindTexture(gl.TEXTURE_2D, null);
+}
+    </script>
+  </head>
+
+  <body onload="start()">
+    <canvas id="glcanvas" width="640" height="480">
+      Your browser doesn't appear to support the <code>&lt;canvas&gt;</code> element.
+    </canvas>
+  </body>
+</html>
\ No newline at end of file
--- a/image/test/crashtests/crashtests.list
+++ b/image/test/crashtests/crashtests.list
@@ -19,16 +19,17 @@ load 1210745-1.gif
 load 1212954-1.svg
 load 1235605.gif
 load 1241728-1.html
 load 1241729-1.html
 load 1242093-1.html
 load 1242778-1.png
 load 1249576-1.png
 load 1253362-1.html
+load 1355898-1.html
 load colormap-range.gif
 HTTP load delayedframe.sjs # A 3-frame animated GIF with an inordinate delay between the second and third frame
 
 # Animated gifs with a very large canvas, but tiny actual content.
 load delaytest.html?523528-1.gif
 load delaytest.html?523528-2.gif
 
 # Bug 1160801 - Ensure that we handle invalid disposal types.