X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=auto_tests%2Ftests%2Fgrid_per_axis.js;h=cac2534acf6c73baf6a6567237c587160791c950;hb=4a401b38137b4c4bd09dff59dafb4665874274f4;hp=e5c960f8842e377366d8a722452bd8c5968f1862;hpb=42aef15a2cbd211c56c860d6915d37ca1dbfccad;p=dygraphs.git diff --git a/auto_tests/tests/grid_per_axis.js b/auto_tests/tests/grid_per_axis.js index e5c960f..cac2534 100644 --- a/auto_tests/tests/grid_per_axis.js +++ b/auto_tests/tests/grid_per_axis.js @@ -198,6 +198,8 @@ GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() { for ( var i = 0; i < gridlines[axis].length; i++) { y = halfDown(g.toDomYCoord(gridlines[axis][i], axis)); // Ignore the alpha value + + // FIXME(pholden): this test fails with a context pixel ratio of 2. var drawnPixeldown2 = Util.samplePixel(g.hidden_, x, y - 2).slice(0, 3); var drawnPixeldown1 = Util.samplePixel(g.hidden_, x, y - 1).slice(0, 3); var drawnPixel = Util.samplePixel(g.hidden_, x, y).slice(0, 3); @@ -249,9 +251,10 @@ GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() { emptyColor, Util.samplePixel(g.hidden_, x + 2, y).slice(0, 3)); } }; + GridPerAxisTestCase.prototype.testGridLinePattern = function() { var opts = { - width : 480, + width : 120, height : 320, errorBars : false, drawXGrid : false, @@ -291,7 +294,7 @@ GridPerAxisTestCase.prototype.testGridLinePattern = function() { } var x, y; // Step through all gridlines of the axis - for ( var i = 0; i < yGridlines.length; i++) { + for (var i = 0; i < yGridlines.length; i++) { y = halfDown(g.toDomYCoord(yGridlines[i], 0)); // Step through the pixels of the line and test the pattern. for (x = halfUp(g.plotter_.area.x); x < g.plotter_.area.w; x++) { @@ -304,11 +307,11 @@ GridPerAxisTestCase.prototype.testGridLinePattern = function() { var pattern = (Math.floor((x) / 10)) % 2; switch (pattern) { case 0: // fill - assertEquals("Unexpected filled grid-pattern color found at pixel: x: " + x + "y: " + assertEquals("Unexpected filled grid-pattern color found at pixel: x: " + x + " y: " + y, [ 0, 0, 255 ], drawnPixel); break; case 1: // no fill - assertEquals("Unexpected empty grid-pattern color found at pixel: x: " + x + "y: " + assertEquals("Unexpected empty grid-pattern color found at pixel: x: " + x + " y: " + y, [ 0, 0, 0 ], drawnPixel); break; }