X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fsimple_drawing.js;h=27e9a1a1989fa7919fa12a641384ed43ab7999ad;hb=8c0599e30c8cfbda74f1f70e8b07e58bc19548ae;hp=75a6e879f2460375348ef47f580aabe0d67d35c7;hpb=5d93f811018b7c7ef41cc0da7e1793ee228e0ed9;p=dygraphs.git diff --git a/auto_tests/tests/simple_drawing.js b/auto_tests/tests/simple_drawing.js index 75a6e87..27e9a1a 100644 --- a/auto_tests/tests/simple_drawing.js +++ b/auto_tests/tests/simple_drawing.js @@ -55,6 +55,7 @@ SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() { strokeStyle: "#008080", lineWidth: 1 }); + g.destroy(); // to balance context saves and destroys. CanvasAssertions.assertBalancedSaveRestore(htx); }; @@ -76,6 +77,7 @@ SimpleDrawingTestCase.prototype.testDrawSimpleRangeZeroToFifty = function() { lineWidth: 1 }); assertEquals(1, lines.length); + g.destroy(); // to balance context saves and destroys. CanvasAssertions.assertBalancedSaveRestore(htx); }; @@ -84,6 +86,7 @@ SimpleDrawingTestCase.prototype.testDrawWithAxis = function() { var g = new Dygraph(graph, ZERO_TO_FIFTY); var htx = g.hidden_ctx_; + g.destroy(); // to balance context saves and destroys. CanvasAssertions.assertBalancedSaveRestore(htx); }; @@ -110,6 +113,7 @@ SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() { // TODO(danvk): figure out a good way to restore this test. // assertEquals(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000")); + g.destroy(); // to balance context saves and destroys. CanvasAssertions.assertBalancedSaveRestore(htx); }; @@ -146,5 +150,6 @@ SimpleDrawingTestCase.prototype.testDrawThickLine = function() { // TODO(danvk): figure out a good way to restore this test. // assertEquals(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000")); + g.destroy(); // to balance context saves and destroys. CanvasAssertions.assertBalancedSaveRestore(htx); };