tor-browser

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

2d.path.roundrect.radius.noargument.worker.js (1445B)


      1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
      2 // OffscreenCanvas test in a worker:2d.path.roundrect.radius.noargument
      3 // Description:Check that roundRect draws a rectangle when no radii are provided.
      4 // Note:
      5 
      6 importScripts("/resources/testharness.js");
      7 importScripts("/html/canvas/resources/canvas-tests.js");
      8 
      9 var t = async_test("Check that roundRect draws a rectangle when no radii are provided.");
     10 var t_pass = t.done.bind(t);
     11 var t_fail = t.step_func(function(reason) {
     12    throw reason;
     13 });
     14 t.step(function() {
     15 
     16  var canvas = new OffscreenCanvas(100, 50);
     17  var ctx = canvas.getContext('2d');
     18 
     19  ctx.fillStyle = '#f00';
     20  ctx.fillRect(0, 0, 100, 50);
     21  ctx.roundRect(10, 10, 80, 30);
     22  ctx.fillStyle = '#0f0';
     23  ctx.fill();
     24  // upper left corner (10, 10)
     25  _assertPixel(canvas, 10,9, 255,0,0,255);
     26  _assertPixel(canvas, 9,10, 255,0,0,255);
     27  _assertPixel(canvas, 10,10, 0,255,0,255);
     28 
     29  // upper right corner (89, 10)
     30  _assertPixel(canvas, 90,10, 255,0,0,255);
     31  _assertPixel(canvas, 89,9, 255,0,0,255);
     32  _assertPixel(canvas, 89,10, 0,255,0,255);
     33 
     34  // lower right corner (89, 39)
     35  _assertPixel(canvas, 89,40, 255,0,0,255);
     36  _assertPixel(canvas, 90,39, 255,0,0,255);
     37  _assertPixel(canvas, 89,39, 0,255,0,255);
     38 
     39  // lower left corner (10, 30)
     40  _assertPixel(canvas, 9,39, 255,0,0,255);
     41  _assertPixel(canvas, 10,40, 255,0,0,255);
     42  _assertPixel(canvas, 10,39, 0,255,0,255);
     43  t.done();
     44 });
     45 done();