Bug 1257593 - test case for webgl framebufferTexture2D() r=jgilbert
authorJerryShih <hshih@mozilla.com>
Thu, 07 Apr 2016 14:14:45 -0700
changeset 292251 3481f843cf295851830f6830527b47e7e976bac8
parent 292250 36c71d8166907b11a064b10644409c4f5e04175f
child 292252 029c36687f2fb6d6568ced20042b22933f026561
push id74788
push userkwierso@gmail.com
push dateThu, 07 Apr 2016 21:19:40 +0000
treeherdermozilla-inbound@7003ce1d2468 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1257593
milestone48.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 1257593 - test case for webgl framebufferTexture2D() r=jgilbert MozReview-Commit-ID: D2wWNoU1vnT
dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html
--- a/dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html
+++ b/dom/canvas/test/webgl-mochitest/test_fuzzing_bugs.html
@@ -2,16 +2,33 @@
 <title>WebGL fuzzy bugs</title>
 <script src="/tests/SimpleTest/SimpleTest.js"></script>
 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
 <script src="driver-info.js"></script>
 <script src="webgl-util.js"></script>
 <body>
 <script>
 
+// Test the framebufferTexture2D() call with a unbound texture.
+function framebufferTexture2D_bug1257593() {
+  var canvas = document.createElement('canvas');
+
+  var gl = null;
+  gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
+  if (!gl) {
+    todo(false, 'WebGL framebufferTexture2D test, webgl is unavailable.');
+    return;
+  }
+
+  var texture = gl.createTexture(); // only createTexture(), but no bindBuffer()
+  gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z, texture, 0);
+
+  ok(true, 'WebGL framebufferTexture2D with unbound texture');
+}
+
 // Test to call ClearBufferXXX() during context lost.
 function webGL2ClearBufferXXX_bug1252414() {
   var canvas = document.createElement('canvas');
 
   var gl = canvas.getContext('webgl2');
   if (!gl) {
     todo(false, 'WebGL2 is not supported');
     return;
@@ -33,16 +50,17 @@ function webGL2ClearBufferXXX_bug1252414
   gl.clearBufferfv(gl.DEPTH, 0, new Float32Array(10));
   gl.clearBufferfi(gl.DEPTH_STENCIL, 0, 0.0, 0);
 
   ok(true, 'WebGL2 clearBufferXXX call during loseContext');
 }
 
 function run() {
   webGL2ClearBufferXXX_bug1252414();
+  framebufferTexture2D_bug1257593();
 
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 
 try {
   var prefArrArr = [