tor-browser

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

2d.pattern.crosscanvas.worker.js (776B)


      1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
      2 // OffscreenCanvas test in a worker:2d.pattern.crosscanvas
      3 // Description:
      4 // Note:
      5 
      6 importScripts("/resources/testharness.js");
      7 importScripts("/html/canvas/resources/canvas-tests.js");
      8 
      9 promise_test(async t => {
     10  var canvas = new OffscreenCanvas(100, 50);
     11  var ctx = canvas.getContext('2d');
     12 
     13  var response = await fetch('/images/green.png')
     14  var blob = await response.blob();
     15  var img = await createImageBitmap(blob);
     16 
     17  var pattern = new OffscreenCanvas(100, 50).getContext('2d').createPattern(img, 'no-repeat');
     18  ctx.fillStyle = '#f00';
     19  ctx.fillRect(0, 0, 100, 50);
     20  ctx.fillStyle = pattern;
     21  ctx.fillRect(0, 0, 100, 50);
     22 
     23  _assertPixel(canvas, 50,25, 0,255,0,255);
     24 }, "");
     25 done();