Preparation Code Preparation HTML (this will be inserted in the <body>
of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script >
var glcanvas = document .createElement ('canvas' );
var gl = glcanvas.getContext ('webgl' );
var canvasHD = document .createElement ('canvas' );
canvasHD.width = 1920 ;
canvasHD.height = 1080 ;
var imgHD = new Image ();
var buffHD = new Uint 8Array (1920 *1080 *4 );
var idHD = document .createElement ("canvas" ).getContext ("2d" ).createImageData (1920 ,1080 );
var texHD = gl.createTexture ();
imgHD.onload = function ( ) {
gl.bindTexture (gl.TEXTURE_2D , texHD);
gl.texImage2D (gl.TEXTURE_2D , 0 , gl.RGBA , gl.RGBA , gl.UNSIGNED_BYTE , imgHD);
};
imgHD.src = "http://i.ytimg.com/vi/qi0iLNEOxD0/maxresdefault.jpg" ;
</script >
Setup JS
Teardown JS
Test cases
Test #1 Title *
Async
Code * gl.bindTexture (gl.TEXTURE_2D , texHD);
gl.texImage2D (gl.TEXTURE_2D , 0 , gl.RGBA , gl.RGBA , gl.UNSIGNED_BYTE , imgHD);
Test #2 Title *
Async
Code * gl.bindTexture (gl.TEXTURE_2D , texHD);
gl.texImage2D (gl.TEXTURE_2D , 0 , gl.RGBA , 1024 , 1024 , 0 , gl.RGBA , gl.UNSIGNED_BYTE , buffHD);
Title *
Async
Code * gl.bindTexture (gl.TEXTURE_2D , texHD);
gl.texImage2D (gl.TEXTURE_2D , 0 , gl.RGBA , gl.RGBA , gl.UNSIGNED_BYTE , idHD);