From 8d04f19ae74a5dca84b8864f9167cdfb6d078aa5 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Wed, 1 Jun 2016 13:46:54 -0400 Subject: [PATCH] Harden the quadFeature testing. I had one of the tests fail twice on my system and this fixes it. --- tests/cases/quadFeature.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/cases/quadFeature.js b/tests/cases/quadFeature.js index 1916f93555..c395064535 100644 --- a/tests/cases/quadFeature.js +++ b/tests/cases/quadFeature.js @@ -460,7 +460,7 @@ describe('geo.quadFeature', function () { expect(buildTime).not.toEqual(quads.buildTime().getMTime()); glCounts = $.extend({}, vgl.mockCounts()); }); - waitForIt('next render', function () { + waitForIt('next render gl A', function () { return vgl.mockCounts().createProgram === (glCounts.createProgram || 0) + 2; }); it('only img quad', function () { @@ -470,7 +470,7 @@ describe('geo.quadFeature', function () { map.draw(); expect(buildTime).not.toEqual(quads.buildTime().getMTime()); }); - waitForIt('next render', function () { + waitForIt('next render gl B', function () { return vgl.mockCounts().activeTexture >= glCounts.activeTexture + 2 && vgl.mockCounts().uniform3fv >= glCounts.uniform3fv + 1 && vgl.mockCounts().bufferSubData >= (glCounts.bufferSubData || 0) + 1; @@ -482,7 +482,7 @@ describe('geo.quadFeature', function () { map.draw(); expect(buildTime).not.toEqual(quads.buildTime().getMTime()); }); - waitForIt('next render', function () { + waitForIt('next render gl C', function () { return vgl.mockCounts().activeTexture === glCounts.activeTexture && vgl.mockCounts().uniform3fv === glCounts.uniform3fv + 2 && vgl.mockCounts().bufferSubData === glCounts.bufferSubData + 1; @@ -497,7 +497,7 @@ describe('geo.quadFeature', function () { quads.data(data); map.draw(); }); - waitForIt('next render', function () { + waitForIt('next render gl D', function () { return vgl.mockCounts().deleteBuffer === (glCounts.deleteBuffer || 0) + 2 && vgl.mockCounts().uniform3fv === glCounts.uniform3fv + 2 && vgl.mockCounts().bufferSubData === glCounts.bufferSubData; @@ -529,12 +529,12 @@ describe('geo.quadFeature', function () { buildTime = quads.buildTime().getMTime(); /* Trigger rerendering */ quads.data(testQuads); + counts = $.extend({}, window._canvasLog.counts); map.draw(); expect(buildTime).not.toEqual(quads.buildTime().getMTime()); - counts = $.extend({}, window._canvasLog.counts); }); - waitForIt('next render', function () { - return window._canvasLog.counts.clearRect === (counts.clearRect || 0) + 1; + waitForIt('next render canvas A', function () { + return window._canvasLog.counts.clearRect >= (counts.clearRect || 0) + 1; }); it('only img quad', function () { counts = $.extend({}, window._canvasLog.counts); @@ -543,7 +543,7 @@ describe('geo.quadFeature', function () { map.draw(); expect(buildTime).not.toEqual(quads.buildTime().getMTime()); }); - waitForIt('next render', function () { + waitForIt('next render canvas B', function () { return window._canvasLog.counts.drawImage === counts.drawImage + 2 && window._canvasLog.counts.clearRect === counts.clearRect + 1; }); @@ -558,7 +558,7 @@ describe('geo.quadFeature', function () { quads.data(data); map.draw(); }); - waitForIt('next render', function () { + waitForIt('next render canvas C', function () { return window._canvasLog.counts.drawImage === counts.drawImage + 200 && window._canvasLog.counts.clearRect === counts.clearRect + 1; });