Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97fe760

Browse files
committed
adapt "replot canvas" test for Chrome 78
1 parent 205f4f8 commit 97fe760

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

test/jasmine/tests/splom_test.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -943,18 +943,24 @@ describe('Test splom interactions:', function() {
943943
.then(done);
944944
});
945945

946-
it('@gl should clear graph and replot when canvas and WebGL context dimensions do not match', function(done) {
946+
it('@noCI @gl should clear graph and replot when canvas and WebGL context dimensions do not match', function(done) {
947947
var fig = Lib.extendDeep({}, require('@mocks/splom_iris.json'));
948948
fig.layout.showlegend = false;
949949

950950
function assertDims(msg, w, h) {
951951
var canvas = gd._fullLayout._glcanvas;
952-
expect(canvas.node().width).toBe(w, msg);
953-
expect(canvas.node().height).toBe(h, msg);
952+
expect(canvas.node().width).toBe(w, msg + '| canvas width');
953+
expect(canvas.node().height).toBe(h, msg + '| canvas height');
954954

955955
var gl = canvas.data()[0].regl._gl;
956-
expect(gl.drawingBufferWidth).toBe(w, msg);
957-
expect(gl.drawingBufferHeight).toBe(h, msg);
956+
if(/Chrome\/78/.test(window.navigator.userAgent)) {
957+
// N.B. for some reason 4096 is the max dimension allowed by Chrome 78
958+
expect(gl.drawingBufferWidth).toBe(Math.min(w, 4096), msg + '| drawingBufferWidth');
959+
expect(gl.drawingBufferHeight).toBe(Math.min(h, 4096), msg + '| drawingBufferHeight');
960+
} else {
961+
expect(gl.drawingBufferWidth).toBe(w, msg + '| drawingBufferWidth');
962+
expect(gl.drawingBufferHeight).toBe(h, msg + '| drawingBufferHeight');
963+
}
958964
}
959965

960966
var methods = ['cleanPlot', 'supplyDefaults', 'doCalcdata'];

0 commit comments

Comments
 (0)