upload-from-srcset-with-empty-data.html (1346B)
1 <!-- 2 Copyright (c) 2020 The Khronos Group Inc. 3 Use of this source code is governed by an MIT-style license that can be 4 found in the LICENSE.txt file. 5 --> 6 7 <!DOCTYPE html> 8 <html> 9 <head> 10 <meta charset="utf-8"> 11 <link rel="stylesheet" href="../../../resources/js-test-style.css"/> 12 <title>Upload From Srcset With Empty Data</title> 13 <script src="../../../js/js-test-pre.js"></script> 14 <script src="../../../js/webgl-test-utils.js"></script> 15 </head> 16 <body> 17 <div id="description"></div> 18 <div id="console"></div> 19 <img srcset="data:,a 1x, data:,b 1w" id="i"> 20 <script> 21 "use strict"; 22 var wtu = WebGLTestUtils; 23 24 var successfullyParsed; 25 26 description("This test ensures WebGL implementations handle srcsets with empty data."); 27 debug("Regression test for <a href='http://crbug.com/1085044'>http://crbug.com/1085044</a>"); 28 29 let gl = wtu.create3DContext(); 30 31 // Note we run this test synchronously, rather than running it in an async 32 // function called after "wtu.awaitOrTimeout(img.decode());". This reproduces 33 // the bug more reliably. 34 let img = document.getElementById("i"); 35 let tex = gl.createTexture(); 36 gl.bindTexture(gl.TEXTURE_2D, tex); 37 // Implementations can decide how to respond to these kinds of bad 38 // inputs, as long as they don't crash. 39 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, img); 40 41 finishTest(); 42 </script> 43 </body> 44 </html>