tor-browser

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

2d.conformance.requirements.basics.html (3634B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <title>OffscreenCanvas test: 2d.conformance.requirements.basics</title>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/html/canvas/resources/canvas-tests.js"></script>
      8 
      9 <h1>2d.conformance.requirements.basics</h1>
     10 <p class="desc">void methods return undefined</p>
     11 
     12 <p class="notes">Defined in "Web IDL" (draft)
     13 <script>
     14 var t = async_test("void methods return undefined");
     15 var t_pass = t.done.bind(t);
     16 var t_fail = t.step_func(function(reason) {
     17    throw reason;
     18 });
     19 t.step(function() {
     20 
     21  var canvas = new OffscreenCanvas(100, 50);
     22  var ctx = canvas.getContext('2d');
     23 
     24  _assertSame(ctx.save(), undefined, "ctx.save()", "undefined");
     25  _assertSame(ctx.restore(), undefined, "ctx.restore()", "undefined");
     26  _assertSame(ctx.scale(1, 1), undefined, "ctx.scale(1, 1)", "undefined");
     27  _assertSame(ctx.rotate(0), undefined, "ctx.rotate(0)", "undefined");
     28  _assertSame(ctx.translate(0, 0), undefined, "ctx.translate(0, 0)", "undefined");
     29  if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported)
     30      _assertSame(ctx.transform(1, 0, 0, 1, 0, 0), undefined, "ctx.transform(1, 0, 0, 1, 0, 0)", "undefined");
     31  }
     32  if (ctx.setTransform) {
     33      _assertSame(ctx.setTransform(1, 0, 0, 1, 0, 0), undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0)", "undefined");
     34      _assertSame(ctx.setTransform(), undefined, "ctx.setTransform()", "undefined");
     35  }
     36  _assertSame(ctx.clearRect(0, 0, 0, 0), undefined, "ctx.clearRect(0, 0, 0, 0)", "undefined");
     37  _assertSame(ctx.fillRect(0, 0, 0, 0), undefined, "ctx.fillRect(0, 0, 0, 0)", "undefined");
     38  _assertSame(ctx.strokeRect(0, 0, 0, 0), undefined, "ctx.strokeRect(0, 0, 0, 0)", "undefined");
     39  _assertSame(ctx.beginPath(), undefined, "ctx.beginPath()", "undefined");
     40  _assertSame(ctx.closePath(), undefined, "ctx.closePath()", "undefined");
     41  _assertSame(ctx.moveTo(0, 0), undefined, "ctx.moveTo(0, 0)", "undefined");
     42  _assertSame(ctx.lineTo(0, 0), undefined, "ctx.lineTo(0, 0)", "undefined");
     43  _assertSame(ctx.quadraticCurveTo(0, 0, 0, 0), undefined, "ctx.quadraticCurveTo(0, 0, 0, 0)", "undefined");
     44  _assertSame(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0), undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0)", "undefined");
     45  _assertSame(ctx.arcTo(0, 0, 0, 0, 1), undefined, "ctx.arcTo(0, 0, 0, 0, 1)", "undefined");
     46  _assertSame(ctx.rect(0, 0, 0, 0), undefined, "ctx.rect(0, 0, 0, 0)", "undefined");
     47  _assertSame(ctx.arc(0, 0, 1, 0, 0, true), undefined, "ctx.arc(0, 0, 1, 0, 0, true)", "undefined");
     48  _assertSame(ctx.fill(), undefined, "ctx.fill()", "undefined");
     49  _assertSame(ctx.stroke(), undefined, "ctx.stroke()", "undefined");
     50  _assertSame(ctx.clip(), undefined, "ctx.clip()", "undefined");
     51  if (ctx.fillText) {
     52      _assertSame(ctx.fillText('test', 0, 0), undefined, "ctx.fillText('test', 0, 0)", "undefined");
     53      _assertSame(ctx.strokeText('test', 0, 0), undefined, "ctx.strokeText('test', 0, 0)", "undefined");
     54  }
     55  if (ctx.putImageData) {
     56      _assertSame(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0), undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0)", "undefined");
     57  }
     58  _assertSame(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0)", "undefined");
     59  _assertSame(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white'), undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white')", "undefined");
     60  t.done();
     61 
     62 });
     63 </script>