tor-browser

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

2d.layer.invalid-calls.save-beginLayer-restore.worker.js (626B)


      1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
      2 // OffscreenCanvas test in a worker:2d.layer.invalid-calls.save-beginLayer-restore
      3 // Description:Raises exception on save() + beginLayer() + restore().
      4 // Note:
      5 
      6 importScripts("/resources/testharness.js");
      7 importScripts("/html/canvas/resources/canvas-tests.js");
      8 
      9 test(t => {
     10  var canvas = new OffscreenCanvas(100, 50);
     11  var ctx = canvas.getContext('2d');
     12 
     13  assert_throws_dom("INVALID_STATE_ERR", function() {
     14    ctx.save();
     15    ctx.beginLayer();
     16    ctx.restore();
     17  });
     18 }, "Raises exception on save() + beginLayer() + restore().");
     19 done();