Bug 1087560 - Fix errors in tests. - r=kamidphish
☠☠ backed out by 3a8b152acd9c ☠ ☠
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 22 Oct 2014 14:58:58 -0700
changeset 212796 64c7041ab5819811e91cec9873c78f02b719a678
parent 212795 4f040d3522a451aed00ce3a420ef8e62e378719b
child 212797 ed403e9595061d360880b465e6b0d0413ae53136
push idunknown
push userunknown
push dateunknown
reviewerskamidphish
bugs1087560
milestone36.0a1
Bug 1087560 - Fix errors in tests. - r=kamidphish
dom/canvas/test/webgl-mochitest.ini
dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html
dom/canvas/test/webgl-mochitest/test_hidden_alpha.html
--- a/dom/canvas/test/webgl-mochitest.ini
+++ b/dom/canvas/test/webgl-mochitest.ini
@@ -1,19 +1,19 @@
 [DEFAULT]
 support-files =
   webgl-mochitest/driver-info.js
   webgl-mochitest/webgl-util.js
 
 [webgl-mochitest/test_backbuffer_channels.html]
-[webgl-mochitest/test_hidden_alpha.html]
 [webgl-mochitest/test_depth_readpixels.html]
 [webgl-mochitest/test_draw.html]
 [webgl-mochitest/test_fb_param.html]
 [webgl-mochitest/test_fb_param_crash.html]
+[webgl-mochitest/test_hidden_alpha.html]
 [webgl-mochitest/test_highp_fs.html]
 [webgl-mochitest/test_no_arr_points.html]
 [webgl-mochitest/test_noprog_draw.html]
 [webgl-mochitest/test_privileged_exts.html]
 [webgl-mochitest/test_texsubimage_float.html]
 [webgl-mochitest/test_webgl_available.html]
 skip-if = toolkit == 'android' #bug 865443- seperate suite - the non_conf* tests pass except for one on armv6 tests
 [webgl-mochitest/test_webgl_conformance.html]
--- a/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
+++ b/dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
@@ -43,16 +43,21 @@ function ok(val, text) {
   debug(status + text);
 }
 
 function todo(val, text) {
   var status = val ? 'Test <font color=\\'orange\\'>UNEXPECTED PASS</font>: '
                    : 'Test <font color=\\'blue\\'  >todo</font>: ';
   debug(status + text);
 }
+
+SimpleTest = {
+  waitForExplicitFinish: function() {},
+  finish: function() {},
+};
 </script>
 <div id='mochi-to-testcase-output'></div>
 \n'''
 
 fin = open(mochiPath, 'rb')
 fout = open(testPath, 'wb')
 includePattern = re.compile('<script\\s*src=[\'"](.*)\\.js[\'"]>\\s*</script>')
 cssPattern = re.compile('<link\\s*rel=[\'"]stylesheet[\'"]\\s*href=[\'"]([^=>]*)[\'"]>')
--- a/dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html
+++ b/dom/canvas/test/webgl-mochitest/test_backbuffer_channels.html
@@ -3,17 +3,17 @@
 <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>
 
 function TestAttribs(attribs) {
-  debug('Testing attribs: ' + JSON.stringify(attribs));
+  ok(true, 'Testing attribs: ' + JSON.stringify(attribs));
   var canvas = document.createElement('canvas');
   var gl = canvas.getContext('experimental-webgl', attribs);
   ok(gl, 'No tested attribs should result in failure to create a context');
   if (!gl)
     return;
 
   var actual = gl.getContextAttributes();
 
--- a/dom/canvas/test/webgl-mochitest/test_hidden_alpha.html
+++ b/dom/canvas/test/webgl-mochitest/test_hidden_alpha.html
@@ -72,17 +72,17 @@ function Test(gl, prog) {
   gl.enable(gl.BLEND);
   gl.blendFunc(gl.ZERO, gl.DST_ALPHA);
 
   var iColor = 64;
   var fColor = iColor / 255.0;
 
   //////////////////
 
-  debug('clear(R,G,B,0)');
+  ok(true, 'clear(R,G,B,0)');
 
   Reset(gl);
 
   gl.clearColor(fColor, fColor, fColor, 0.0);
   gl.clear(gl.COLOR_BUFFER_BIT);
 
   var dataURL_pre = gl.canvas.toDataURL();
   //console.log('Before blending: ' + dataURL_pre);
@@ -97,17 +97,17 @@ function Test(gl, prog) {
 
   var dataURL_post = gl.canvas.toDataURL();
   //console.log('After blending: ' + dataURL_post);
   ok(dataURL_post == dataURL_pre,
      'toDataURL should be unchanged after blending.');
 
   //////////////////
 
-  debug('mask(R,G,B,0), clear(R,G,B,1)');
+  ok(true, 'mask(R,G,B,0), clear(R,G,B,1)');
 
   Reset(gl);
 
   gl.colorMask(true, true, true, false);
   gl.clearColor(fColor, fColor, fColor, 1.0);
   gl.clear(gl.COLOR_BUFFER_BIT);
   gl.colorMask(true, true, true, true);
 
@@ -124,16 +124,17 @@ function Test(gl, prog) {
   ok(gl.getError() == 0, 'Should have no errors.');
 
   dataURL_post = gl.canvas.toDataURL();
   //console.log('After blending: ' + dataURL_post);
   ok(dataURL_post == dataURL_pre,
      'toDataURL should be unchanged after blending.');
 
   ok(true, 'Test complete.');
+  SimpleTest.finish();
 }
 
 (function(){
   var canvas = document.getElementById('canvas');
   var attribs = {
     alpha: false,
     antialias: false,
     premultipliedAlpha: false,
@@ -141,13 +142,14 @@ function Test(gl, prog) {
   var gl = canvas.getContext('experimental-webgl', attribs);
   ok(gl, 'WebGL should work.');
   ok(gl.getParameter(gl.ALPHA_BITS) == 0, 'Shouldn\'t have alpha bits.');
 
   var prog = WebGLUtil.createProgramByIds(gl, 'vs', 'fs');
   ok(prog, 'Program should link.');
   prog.aPosCoord = gl.getAttribLocation(prog, 'aPosCoord');
 
+  SimpleTest.waitForExplicitFinish();
   setTimeout(function(){ Test(gl, prog); }, 500);
 })();
 
 </script>
 </body>