https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 4704f3bfde403308042dd2136033e20f3473fc12 authored by Xidorn Quan on 07 April 2018, 06:37:41 UTC
Add test for checking property order after setting property on CSSStyleDeclaration
Tip revision: 4704f3b
2d.gradient.linear.nonfinite.worker.js
// DO NOT EDIT! This test has been generated by tools/gentest.py.
// OffscreenCanvas test in a worker:2d.gradient.linear.nonfinite
// Description:createLinearGradient() throws TypeError if arguments are not finite
// Note:

importScripts("/resources/testharness.js");
importScripts("/common/canvas-tests.js");

var t = async_test("createLinearGradient() throws TypeError if arguments are not finite");
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(-Infinity, 0, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(NaN, 0, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, -Infinity, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, NaN, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infinity, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, -Infinity, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, NaN, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, -Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, NaN); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, 1, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, Infinity, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, 1, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, Infinity, 0); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, Infinity, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, 1, Infinity); });
assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infinity, Infinity); });

t.done();

});
done();
back to top