Skip to content

Commit

Permalink
Harden the quadFeature testing.
Browse files Browse the repository at this point in the history
I had one of the tests fail twice on my system and this fixes it.
  • Loading branch information
manthey committed Jun 1, 2016
1 parent 82e023d commit 8d04f19
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/cases/quadFeature.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
});
Expand All @@ -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;
});
Expand Down

0 comments on commit 8d04f19

Please sign in to comment.