tor-browser

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

test_canvas_size.html (1127B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset='UTF-8'>
      5  <script src='/tests/SimpleTest/SimpleTest.js'></script>
      6  <link rel='stylesheet' href='/tests/SimpleTest/test.css'>
      7 </head>
      8 <title>WebGL test: Framebuffer maximum size test. (Bug 1290333)</title>
      9 <body>
     10 <script>
     11 function TestSize(contextName, testSize) {
     12  var attributes = {
     13    antialias: false,
     14  };
     15 
     16  var canvas = document.createElement('canvas');
     17  var gl = canvas.getContext(contextName, attributes);
     18 
     19  if (!gl) {
     20    todo(false, contextName + 'is unavailable.');
     21    return;
     22  }
     23  gl.canvas.width = testSize;
     24  gl.canvas.height = testSize;
     25 
     26  ok(true, contextName + 'test complete.');
     27 }
     28 
     29 function run() {
     30  TestSize('webgl', 16384);
     31  TestSize('webgl2', 16384);
     32 
     33  ok(true, 'Test complete.');
     34  SimpleTest.finish();
     35 }
     36 
     37 ////////////////////////////////////////
     38 
     39 SimpleTest.waitForExplicitFinish();
     40 
     41 try {
     42  var prefPairList = [
     43    ['webgl.force-enabled', true],
     44  ];
     45  var prefEnv = {'set': prefPairList};
     46  SpecialPowers.pushPrefEnv(prefEnv, run);
     47 } catch (e) {
     48  warning('No SpecialPowers, but trying WebGL2 anyway...');
     49  run();
     50 }
     51 
     52 </script>
     53 </body>
     54 </html>