projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reduce the width of testGridLinePattern from 480px to 120px, making the test run...
[dygraphs.git]
/
auto_tests
/
tests
/
grid_per_axis.js
diff --git
a/auto_tests/tests/grid_per_axis.js
b/auto_tests/tests/grid_per_axis.js
index
3dd2a89
..
9731514
100644
(file)
--- a/
auto_tests/tests/grid_per_axis.js
+++ b/
auto_tests/tests/grid_per_axis.js
@@
-251,7
+251,7
@@
GridPerAxisTestCase.prototype.testPerAxisGridWidth = function() {
};
GridPerAxisTestCase.prototype.testGridLinePattern = function() {
var opts = {
};
GridPerAxisTestCase.prototype.testGridLinePattern = function() {
var opts = {
- width :
48
0,
+ width :
12
0,
height : 320,
errorBars : false,
drawXGrid : false,
height : 320,
errorBars : false,
drawXGrid : false,
@@
-270,7
+270,7
@@
GridPerAxisTestCase.prototype.testGridLinePattern = function() {
axes : {
y : {
gridLineColor : "#0000ff",
axes : {
y : {
gridLineColor : "#0000ff",
- gridLinePattern : [
4, 4
]
+ gridLinePattern : [
10, 10
]
}
}
};
}
}
};
@@
-290,22
+290,25
@@
GridPerAxisTestCase.prototype.testGridLinePattern = function() {
return Math.round(y) - 1;
}
var x, y;
return Math.round(y) - 1;
}
var x, y;
- x = halfUp(g.plotter_.area.x);
// Step through all gridlines of the axis
// 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.
y = halfDown(g.toDomYCoord(yGridlines[i], 0));
// Step through the pixels of the line and test the pattern.
- for (x; x < g.plotter_.area.w; x++) {
+ for (x = halfUp(g.plotter_.area.x); x < g.plotter_.area.w; x++) {
+ // avoid checking the edge pixels since they differ depending on the OS.
+ var pixelpos = x % 10;
+ if(pixelpos < 1 || pixelpos > 8) continue;
+
// Ignore alpha
var drawnPixel = Util.samplePixel(g.hidden_, x, y).slice(0,3);
// Ignore alpha
var drawnPixel = Util.samplePixel(g.hidden_, x, y).slice(0,3);
- var pattern = (Math.floor((x) /
4
)) % 2;
+ var pattern = (Math.floor((x) /
10
)) % 2;
switch (pattern) {
case 0: // fill
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
+ 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;
}
+ y, [ 0, 0, 0 ], drawnPixel);
break;
}