tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

getextension-while-pbo-bound-stability.html (1681B)


      1 <!--
      2 Copyright (c) 2019 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 <title>WebGL2 getExtension while PBO bound stability conformance test.</title>
     12 <link rel="stylesheet" href="../../resources/js-test-style.css"/>
     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 <script>
     20 "use strict";
     21 
     22 var wtu = WebGLTestUtils;
     23 
     24 function runTest(extension_name) {
     25  debug("");
     26  debug("getExtension('" + extension_name + "') while PIXEL_UNPACK_BUFFER bound should be stable");
     27 
     28  var gl = wtu.create3DContext(null, undefined, 2);
     29  if (!gl) {
     30    testFailed("Fail to get a WebGL context");
     31    return;
     32  }
     33 
     34  var pbo = gl.createBuffer();
     35  gl.bindBuffer(gl.PIXEL_UNPACK_BUFFER, pbo);
     36  var ext = gl.getExtension('EXT_color_buffer_float');
     37  var gl_texture_float_linear = gl.getExtension(extension_name);
     38  wtu.glErrorShouldBe(gl, gl.NO_ERROR, "Late-enable of extension should succeed");
     39  if (pbo != gl.getParameter(gl.PIXEL_UNPACK_BUFFER_BINDING)) {
     40      testFailed("Fail to maintain PIXEL_UNPACK_BUFFER binding when enabling extension " + extension_name);
     41  }
     42 }
     43 
     44 function runTests() {
     45  debug("This is a regression test for <a href='https://bugs.chromium.org/p/chromium/issues/detail?id=641643'>Chromium Issue 641642</a>");
     46  runTest('EXT_color_buffer_float');
     47  runTest('OES_texture_float_linear');
     48 }
     49 
     50 runTests();
     51 
     52 debug("");
     53 var successfullyParsed = true;
     54 </script>
     55 <script src="../../js/js-test-post.js"></script>
     56 </body>
     57 </html>