File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change
1
+ var Plotly = require ( '@lib' ) ;
2
+
3
+ var createGraphDiv = require ( '../assets/create_graph_div' ) ;
4
+ var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
5
+ var failTest = require ( '../assets/fail_test' ) ;
6
+
7
+ describe ( 'Plotly w/o WebGL support:' , function ( ) {
8
+ var gd ;
9
+
10
+ beforeEach ( function ( ) {
11
+ gd = createGraphDiv ( ) ;
12
+ } ) ;
13
+
14
+ afterEach ( function ( ) {
15
+ Plotly . purge ( gd ) ;
16
+ destroyGraphDiv ( ) ;
17
+ } ) ;
18
+
19
+ function checkNoWebGLMsg ( visible ) {
20
+ var glDiv = gd . querySelector ( 'div.gl-container' ) ;
21
+ var msg = glDiv . querySelector ( 'div.no-webgl' ) ;
22
+ if ( visible ) {
23
+ expect ( msg . innerHTML . substr ( 0 , 22 ) ) . toBe ( 'WebGL is not supported' ) ;
24
+ } else {
25
+ expect ( msg ) . toBe ( null ) ;
26
+ }
27
+ }
28
+
29
+ it ( 'gl3d subplots' , function ( done ) {
30
+ Plotly . react ( gd , require ( '@mocks/gl3d_autocolorscale.json' ) )
31
+ . then ( function ( ) {
32
+ checkNoWebGLMsg ( true ) ;
33
+ return Plotly . react ( gd , require ( '@mocks/10.json' ) ) ;
34
+ } )
35
+ . then ( function ( ) {
36
+ checkNoWebGLMsg ( false ) ;
37
+ } )
38
+ . catch ( failTest )
39
+ . then ( done ) ;
40
+ } ) ;
41
+ } ) ;
Original file line number Diff line number Diff line change @@ -188,7 +188,8 @@ func.defaultConfig = {
188
188
flags : [
189
189
'--touch-events' ,
190
190
'--window-size=' + argv . width + ',' + argv . height ,
191
- isCI ? '--ignore-gpu-blacklist' : ''
191
+ isCI ? '--ignore-gpu-blacklist' : '' ,
192
+ ( isBundleTest && basename ( testFileGlob ) === 'no_webgl' ) ? '--disable-webgl' : ''
192
193
]
193
194
} ,
194
195
_Firefox : {
You can’t perform that action at this time.
0 commit comments