OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> |
| 3 <title>OffscreenCanvas test: 2d.gradient.linear.nonfinite</title> |
| 4 <script src="/resources/testharness.js"></script> |
| 5 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="/common/canvas-tests.js"></script> |
| 7 |
| 8 <h1>2d.gradient.linear.nonfinite</h1> |
| 9 <p class="desc">createLinearGradient() throws TypeError if arguments are not fin
ite</p> |
| 10 |
| 11 |
| 12 <script> |
| 13 var t = async_test("createLinearGradient() throws TypeError if arguments are not
finite"); |
| 14 t.step(function() { |
| 15 |
| 16 var offscreenCanvas = new OffscreenCanvas(100, 50); |
| 17 var ctx = offscreenCanvas.getContext('2d'); |
| 18 |
| 19 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0
, 1, 0); }); |
| 20 assert_throws(new TypeError(), function() { ctx.createLinearGradient(-Infinity,
0, 1, 0); }); |
| 21 assert_throws(new TypeError(), function() { ctx.createLinearGradient(NaN, 0, 1,
0); }); |
| 22 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity
, 1, 0); }); |
| 23 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, -Infinit
y, 1, 0); }); |
| 24 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, NaN, 1,
0); }); |
| 25 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infin
ity, 0); }); |
| 26 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, -Infi
nity, 0); }); |
| 27 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, NaN,
0); }); |
| 28 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, In
finity); }); |
| 29 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, -I
nfinity); }); |
| 30 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, Na
N); }); |
| 31 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, I
nfinity, 1, 0); }); |
| 32 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, I
nfinity, Infinity, 0); }); |
| 33 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, I
nfinity, Infinity, Infinity); }); |
| 34 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, I
nfinity, 1, Infinity); }); |
| 35 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0
, Infinity, 0); }); |
| 36 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0
, Infinity, Infinity); }); |
| 37 assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0
, 1, Infinity); }); |
| 38 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity
, Infinity, 0); }); |
| 39 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity
, Infinity, Infinity); }); |
| 40 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity
, 1, Infinity); }); |
| 41 assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infin
ity, Infinity); }); |
| 42 |
| 43 t.done(); |
| 44 |
| 45 }); |
| 46 </script> |
OLD | NEW |