[Plot] Add test for buffer size

Add test case for usage of drawing buffer size as
reported by WebGL (instead of assuming we always got
the full size we requested.) WTD-852.
This commit is contained in:
Victor Woeltjen 2015-02-09 16:07:05 -08:00
parent 2bbe845f18
commit 790397ae0f

View File

@ -106,6 +106,19 @@ define(
expect(mockGL.drawArrays)
.toHaveBeenCalledWith("TRIANGLE_FAN", 0, 4);
});
it("uses buffer sizes reported by WebGL", function () {
// Make sure that GLChart uses the GL buffer size, which may
// differ from what canvas requested. WTD-852
mockCanvas.width = 300;
mockCanvas.height = 150;
mockGL.drawingBufferWidth = 200;
mockGL.drawingBufferHeight = 175;
glChart.clear();
expect(mockGL.viewport).toHaveBeenCalledWith(0, 0, 200, 175);
});
});
}
);