tor-browser

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

2d.gradient.linear.nonfinite.worker.js (2917B)


      1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
      2 // OffscreenCanvas test in a worker:2d.gradient.linear.nonfinite
      3 // Description:createLinearGradient() throws TypeError if arguments are not finite
      4 // Note:<p class="notes">Defined in "Web IDL" (draft)
      5 
      6 importScripts("/resources/testharness.js");
      7 importScripts("/html/canvas/resources/canvas-tests.js");
      8 
      9 var t = async_test("createLinearGradient() throws TypeError if arguments are not finite");
     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  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, 1, 0); });
     20  assert_throws_js(TypeError, function() { ctx.createLinearGradient(-Infinity, 0, 1, 0); });
     21  assert_throws_js(TypeError, function() { ctx.createLinearGradient(NaN, 0, 1, 0); });
     22  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, 1, 0); });
     23  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, -Infinity, 1, 0); });
     24  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, NaN, 1, 0); });
     25  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, Infinity, 0); });
     26  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, -Infinity, 0); });
     27  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, NaN, 0); });
     28  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, Infinity); });
     29  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, -Infinity); });
     30  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, NaN); });
     31  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, 1, 0); });
     32  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); });
     33  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); });
     34  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); });
     35  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, Infinity, 0); });
     36  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); });
     37  assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, 1, Infinity); });
     38  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, Infinity, 0); });
     39  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, Infinity, Infinity); });
     40  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, 1, Infinity); });
     41  assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, Infinity, Infinity); });
     42  t.done();
     43 });
     44 done();