3 import "testhelper.js" as Helper
5 id:canvas; width:100;height:50; renderTarget: Canvas.Image
7 name: "gradient"; when: windowShown
8 function test_basic() {
9 var ctx = canvas.getContext('2d');
11 ctx.fillStyle = '#0f0';
12 ctx.fillRect(0, 0, 100, 50);
13 var g = ctx.createLinearGradient(0, 0, 0, 50);
15 ctx.fillRect(0, 0, 100, 50);
16 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255,2));
20 function test_interpolate() {
21 var ctx = canvas.getContext('2d');
24 ctx.fillStyle = '#ff0';
25 ctx.fillRect(0, 0, 100, 50);
26 var g = ctx.createLinearGradient(0, 0, 100, 0);
27 g.addColorStop(0, 'rgba(0,0,255, 0)');
28 g.addColorStop(1, 'rgba(0,0,255, 1)');
30 ctx.fillRect(0, 0, 100, 50);
31 //verify(Helper.comparePixel(ctx, 25,25, 191,191,63,255,3));
32 //verify(Helper.comparePixel(ctx, 50,25, 127,127,127,255,3));
33 //verify(Helper.comparePixel(ctx, 75,25, 63,63,191,255,3));
36 var g = ctx.createLinearGradient(0, 0, 100, 0);
37 g.addColorStop(0, '#ff0');
38 g.addColorStop(1, '#00f');
40 ctx.fillRect(0, 0, 100, 50);
41 //verify(Helper.comparePixel(ctx, 25,25, 191,191,63,255,3));
42 //verify(Helper.comparePixel(ctx, 50,25, 127,127,127,255,3));
43 //verify(Helper.comparePixel(ctx, 75,25, 63,63,191,255,3));
47 var g = ctx.createLinearGradient(0, 0, 100, 0);
48 g.addColorStop(0, 'rgba(255,255,0, 0)');
49 g.addColorStop(1, 'rgba(0,0,255, 1)');
51 ctx.fillRect(0, 0, 100, 50);
52 //verify(Helper.comparePixel(ctx, 25,25, 191,191,63,63,3));
53 //verify(Helper.comparePixel(ctx, 50,25, 127,127,127,127,3));
54 //verify(Helper.comparePixel(ctx, 75,25, 63,63,191,191,3));
58 var g = ctx.createLinearGradient(0, 0, 200, 0);
59 g.addColorStop(0, '#ff0');
60 g.addColorStop(0.5, '#0ff');
61 g.addColorStop(1, '#f0f');
63 ctx.fillRect(0, 0, 200, 50);
64 //verify(Helper.comparePixel(ctx, 50,25, 127,255,127,255,3));
65 //verify(Helper.comparePixel(ctx, 100,25, 0,255,255,255,3));
66 //verify(Helper.comparePixel(ctx, 150,25, 127,127,255,255,3));
69 ctx.fillStyle = '#f00';
70 ctx.fillRect(0, 0, 100, 50);
72 var g = ctx.createLinearGradient(25, 0, 75, 0);
73 g.addColorStop(0.4, '#0f0');
74 g.addColorStop(0.6, '#0f0');
77 ctx.fillRect(0, 0, 100, 50);
78 //verify(Helper.comparePixel(ctx, 20,25, 0,255,0,255,2));
79 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255,2));
80 //verify(Helper.comparePixel(ctx, 80,25, 0,255,0,255,2));
84 ctx.canvas.width = 200;
85 var g = ctx.createLinearGradient(0, 0, 200, 0);
86 g.addColorStop(0, '#f00');
87 g.addColorStop(0, '#ff0');
88 g.addColorStop(0.25, '#00f');
89 g.addColorStop(0.25, '#0f0');
90 g.addColorStop(0.25, '#0f0');
91 g.addColorStop(0.25, '#0f0');
92 g.addColorStop(0.25, '#ff0');
93 g.addColorStop(0.5, '#00f');
94 g.addColorStop(0.5, '#0f0');
95 g.addColorStop(0.75, '#00f');
96 g.addColorStop(0.75, '#f00');
97 g.addColorStop(0.75, '#ff0');
98 g.addColorStop(0.5, '#0f0');
99 g.addColorStop(0.5, '#0f0');
100 g.addColorStop(0.5, '#ff0');
101 g.addColorStop(1, '#00f');
103 ctx.fillRect(0, 0, 200, 50);
104 //verify(Helper.comparePixel(ctx, 49,25, 0,0,255,255,16));
105 //verify(Helper.comparePixel(ctx, 51,25, 255,255,0,255,16));
106 //verify(Helper.comparePixel(ctx, 99,25, 0,0,255,255,16));
107 //verify(Helper.comparePixel(ctx, 101,25, 255,255,0,255,16));
108 //verify(Helper.comparePixel(ctx, 149,25, 0,0,255,255,16));
109 //verify(Helper.comparePixel(ctx, 151,25, 255,255,0,255,16));
110 ctx.canvas.width = 100;
113 var g = ctx.createLinearGradient(0, 0, 100, 0);
114 var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ];
115 for (var p = 0; p < ps.length; ++p)
117 g.addColorStop(ps[p], '#0f0');
118 for (var i = 0; i < 15; ++i)
119 g.addColorStop(ps[p], '#f00');
120 g.addColorStop(ps[p], '#0f0');
123 ctx.fillRect(0, 0, 100, 50);
124 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255));
125 //verify(Helper.comparePixel(ctx, 30,25, 0,255,0,255));
126 //verify(Helper.comparePixel(ctx, 40,25, 0,255,0,255));
127 //verify(Helper.comparePixel(ctx, 60,25, 0,255,0,255));
128 //verify(Helper.comparePixel(ctx, 80,25, 0,255,0,255));
132 var g = ctx.createLinearGradient(0, 0, 100, 0);
133 g.addColorStop(0, '#0f0');
134 g.addColorStop(1, '#0f0');
136 ctx.fillRect(0, 0, 100, 50);
137 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
142 var g = ctx.createLinearGradient(0, 0, 0, 50);
143 g.addColorStop(0, '#ff0');
144 g.addColorStop(1, '#00f');
146 ctx.fillRect(0, 0, 100, 50);
147 //verify(Helper.comparePixel(ctx, 50,12, 191,191,63,255,10));
148 //verify(Helper.comparePixel(ctx, 50,25, 127,127,127,255,5));
149 //verify(Helper.comparePixel(ctx, 50,37, 63,63,191,255,10));
154 ctx.fillStyle = '#0f0';
155 ctx.fillRect(0, 0, 100, 50);
157 var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction)
158 g.addColorStop(0, '#f00');
159 g.addColorStop(1, '#f00');
161 ctx.fillRect(0, 0, 100, 50);
162 //verify(Helper.comparePixel(ctx, 40,20, 0,255,0,255,2));
167 function test_radial() {
168 var ctx = canvas.getContext('2d');
170 ctx.fillStyle = '#0f0';
171 ctx.fillRect(0, 0, 100, 50);
173 var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50);
174 g.addColorStop(0, '#f00');
175 g.addColorStop(1, '#f00');
177 ctx.fillRect(0, 0, 100, 50);
179 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
180 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
181 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
182 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
183 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
184 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
185 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
186 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
187 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
190 ctx.fillStyle = '#f00';
191 ctx.fillRect(0, 0, 100, 50);
193 g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101);
194 g.addColorStop(0, '#0f0');
195 g.addColorStop(1, '#f00');
197 ctx.fillRect(0, 0, 100, 50);
199 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
200 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
201 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
202 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
203 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
204 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
205 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
206 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
207 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
211 ctx.fillStyle = '#f00';
212 ctx.fillRect(0, 0, 100, 50);
214 g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100);
215 g.addColorStop(0, '#0f0');
216 g.addColorStop(1, '#f00');
218 ctx.fillRect(0, 0, 100, 50);
220 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
221 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
222 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
223 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
224 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
225 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
226 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
227 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
228 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
231 ctx.fillStyle = '#f00';
232 ctx.fillRect(0, 0, 100, 50);
234 g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100);
235 g.addColorStop(0, '#f00');
236 g.addColorStop(1, '#0f0');
238 ctx.fillRect(0, 0, 100, 50);
240 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
241 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
242 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
243 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
244 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
245 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
246 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
247 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
248 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
251 var tol = 1; // tolerance to avoid antialiasing artifacts
253 ctx.fillStyle = '#0f0';
254 ctx.fillRect(0, 0, 100, 50);
256 ctx.fillStyle = '#f00';
258 ctx.moveTo(30+tol, 40);
259 ctx.lineTo(110, -20+tol);
260 ctx.lineTo(110, 100-tol);
263 g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4);
264 g.addColorStop(0, '#0f0');
265 g.addColorStop(1, '#0f0');
267 ctx.fillRect(0, 0, 100, 50);
269 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
270 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
271 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
272 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
273 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
274 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
275 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
276 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
277 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
280 var tol = 1; // tolerance to avoid antialiasing artifacts
282 ctx.fillStyle = '#0f0';
283 ctx.fillRect(0, 0, 100, 50);
285 g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4);
286 g.addColorStop(0, '#f00');
287 g.addColorStop(1, '#f00');
289 ctx.fillRect(0, 0, 100, 50);
291 ctx.fillStyle = '#0f0';
293 ctx.moveTo(30-tol, 40);
294 ctx.lineTo(110, -20-tol);
295 ctx.lineTo(110, 100+tol);
298 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
299 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
300 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
301 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
302 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
303 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
304 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
305 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
306 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
309 ctx.fillStyle = '#f00';
310 ctx.fillRect(0, 0, 100, 50);
312 g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101);
313 g.addColorStop(0, '#f00');
314 g.addColorStop(1, '#0f0');
316 ctx.fillRect(0, 0, 100, 50);
318 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
319 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
320 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
321 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
322 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
323 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
324 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
325 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
326 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
329 ctx.fillStyle = '#0f0';
330 ctx.fillRect(0, 0, 100, 50);
332 g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20);
333 g.addColorStop(0, '#f00');
334 g.addColorStop(1, '#f00');
336 ctx.fillRect(0, 0, 100, 50);
338 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
339 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
340 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
341 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
342 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
343 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
344 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
345 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
346 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
349 ctx.fillStyle = '#f00';
350 ctx.fillRect(0, 0, 100, 50);
352 g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200);
353 g.addColorStop(0, '#0f0');
354 g.addColorStop(1, '#f00');
356 ctx.fillRect(0, 0, 100, 50);
358 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
359 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
360 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
361 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
362 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
363 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
364 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
365 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
366 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
369 ctx.fillStyle = '#f00';
370 ctx.fillRect(0, 0, 100, 50);
372 g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100);
373 g.addColorStop(0, '#f00');
374 g.addColorStop(1, '#0f0');
376 ctx.fillRect(0, 0, 100, 50);
378 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
379 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
380 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
381 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
382 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
383 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
384 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
385 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
386 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
389 ctx.fillStyle = '#f00';
390 ctx.fillRect(0, 0, 100, 50);
392 g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100);
393 g.addColorStop(0, '#f00');
394 g.addColorStop(0.993, '#f00');
395 g.addColorStop(1, '#0f0');
397 ctx.fillRect(0, 0, 100, 50);
399 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
400 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
401 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
402 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
403 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
404 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
405 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
406 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
407 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
410 try { var err = false;
411 ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1);
412 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); }
413 try { var err = false;
414 ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1);
415 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); }
416 try { var err = false;
417 ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1);
418 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); }
424 try { var err = false;
425 ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1);
426 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); }
427 try { var err = false;
428 ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1);
429 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); }
430 try { var err = false;
431 ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1);
432 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); }
433 try { var err = false;
434 ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1);
435 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); }
436 try { var err = false;
437 ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1);
438 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); }
439 try { var err = false;
440 ctx.createRadialGradient(0, NaN, 1, 0, 0, 1);
441 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); }
442 try { var err = false;
443 ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1);
444 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); }
445 try { var err = false;
446 ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1);
447 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); }
448 try { var err = false;
449 ctx.createRadialGradient(0, 0, NaN, 0, 0, 1);
450 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); }
451 try { var err = false;
452 ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1);
453 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); }
454 try { var err = false;
455 ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1);
456 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); }
457 try { var err = false;
458 ctx.createRadialGradient(0, 0, 1, NaN, 0, 1);
459 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); }
460 try { var err = false;
461 ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1);
462 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); }
463 try { var err = false;
464 ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1);
465 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); }
466 try { var err = false;
467 ctx.createRadialGradient(0, 0, 1, 0, NaN, 1);
468 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); }
469 try { var err = false;
470 ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity);
471 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); }
472 try { var err = false;
473 ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity);
474 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); }
475 try { var err = false;
476 ctx.createRadialGradient(0, 0, 1, 0, 0, NaN);
477 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); }
478 try { var err = false;
479 ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1);
480 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); }
481 try { var err = false;
482 ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1);
483 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); }
484 try { var err = false;
485 ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1);
486 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); }
487 try { var err = false;
488 ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1);
489 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); }
490 try { var err = false;
491 ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
492 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); }
493 try { var err = false;
494 ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
495 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); }
496 try { var err = false;
497 ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1);
498 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); }
499 try { var err = false;
500 ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity);
501 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); }
502 try { var err = false;
503 ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity);
504 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); }
505 try { var err = false;
506 ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1);
507 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); }
508 try { var err = false;
509 ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1);
510 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); }
511 try { var err = false;
512 ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity);
513 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); }
514 try { var err = false;
515 ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity);
516 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); }
517 try { var err = false;
518 ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1);
519 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); }
520 try { var err = false;
521 ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity);
522 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); }
523 try { var err = false;
524 ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity);
525 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); }
526 try { var err = false;
527 ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1);
528 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); }
529 try { var err = false;
530 ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1);
531 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); }
532 try { var err = false;
533 ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1);
534 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); }
535 try { var err = false;
536 ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity);
537 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); }
538 try { var err = false;
539 ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity);
540 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); }
541 try { var err = false;
542 ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1);
543 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); }
544 try { var err = false;
545 ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity);
546 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); }
547 try { var err = false;
548 ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity);
549 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); }
550 try { var err = false;
551 ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1);
552 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); }
553 try { var err = false;
554 ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1);
555 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); }
556 try { var err = false;
557 ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity);
558 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); }
559 try { var err = false;
560 ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity);
561 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); }
562 try { var err = false;
563 ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1);
564 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); }
565 try { var err = false;
566 ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity);
567 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); }
568 try { var err = false;
569 ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity);
570 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); }
571 try { var err = false;
572 ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1);
573 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); }
574 try { var err = false;
575 ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1);
576 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); }
577 try { var err = false;
578 ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1);
579 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); }
580 try { var err = false;
581 ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity);
582 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); }
583 try { var err = false;
584 ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity);
585 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); }
586 try { var err = false;
587 ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1);
588 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); }
589 try { var err = false;
590 ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity);
591 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); }
592 try { var err = false;
593 ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity);
594 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); }
595 try { var err = false;
596 ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1);
597 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); }
598 try { var err = false;
599 ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1);
600 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); }
601 try { var err = false;
602 ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity);
603 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); }
604 try { var err = false;
605 ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity);
606 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); }
607 try { var err = false;
608 ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1);
609 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); }
610 try { var err = false;
611 ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity);
612 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); }
613 try { var err = false;
614 ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity);
615 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); }
616 try { var err = false;
617 ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1);
618 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); }
619 try { var err = false;
620 ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1);
621 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); }
622 try { var err = false;
623 ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity);
624 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); }
625 try { var err = false;
626 ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity);
627 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); }
628 try { var err = false;
629 ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1);
630 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); }
631 try { var err = false;
632 ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity);
633 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); }
634 try { var err = false;
635 ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity);
636 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); }
637 try { var err = false;
638 ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1);
639 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); }
640 try { var err = false;
641 ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity);
642 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); }
643 try { var err = false;
644 ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity);
645 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); }
646 try { var err = false;
647 ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity);
648 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); }
652 ctx.fillStyle = '#f00';
653 ctx.fillRect(0, 0, 100, 50);
654 g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20);
655 g.addColorStop(0, '#f00');
656 g.addColorStop(1, '#0f0');
657 ctx.fillStyle = g;ctx.fillRect(0, 0, 100, 50);
659 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
660 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));//verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
661 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
662 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
663 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
664 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
665 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
668 ctx.fillStyle = '#f00';
669 ctx.fillRect(0, 0, 100, 50);
670 g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10);
671 g.addColorStop(0, '#0f0');
672 g.addColorStop(1, '#f00');
673 ctx.fillStyle = g;ctx.fillRect(0, 0, 100, 50);
675 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
676 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));//verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
677 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
678 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
679 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
680 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
681 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
684 ctx.fillStyle = '#f00';
685 ctx.fillRect(0, 0, 100, 50);
686 g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10);
687 g.addColorStop(0, '#0f0');
688 g.addColorStop(0.001, '#f00');
689 g.addColorStop(1, '#f00');ctx.fillStyle = g;
690 ctx.fillRect(0, 0, 100, 50);
692 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));//verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
693 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
694 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
695 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
696 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
697 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
698 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
701 ctx.fillStyle = '#0f0';
702 ctx.fillRect(0, 0, 100, 50);
703 g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100);
704 g.addColorStop(0, '#f00');
705 g.addColorStop(1, '#f00');
706 ctx.fillStyle = g;ctx.fillRect(0, 0, 100, 50);
708 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
709 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));//verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
710 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
711 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
712 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
713 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
714 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
718 ctx.fillStyle = '#f00';
719 ctx.fillRect(0, 0, 100, 50);
720 g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150);
721 g.addColorStop(0, '#f00');
722 g.addColorStop(0.01, '#0f0');
723 g.addColorStop(0.99, '#0f0');g.addColorStop(1, '#f00');
725 ctx.fillRect(0, 0, 100, 50);
726 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
727 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
728 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
729 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));//verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
730 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
731 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
732 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));//verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
735 ctx.fillStyle = '#0f0';
736 ctx.fillRect(0, 0, 100, 50);
737 g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50);
738 g.addColorStop(0, '#f00');
739 g.addColorStop(1, '#f00');
740 ctx.fillStyle = g;ctx.fillRect(0, 0, 100, 50);
742 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
743 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));//verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
744 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
745 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
746 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
747 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
748 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
751 g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2);
752 g.addColorStop(0, '#0f0');
753 g.addColorStop(0.5, '#0f0');g.addColorStop(0.51, '#f00');
754 g.addColorStop(1, '#f00');
756 ctx.translate(50, 25);ctx.scale(10, 10);
757 ctx.fillRect(-5, -2.5, 10, 5);
758 //verify(Helper.comparePixel(ctx, 25,25, 0,255,0,255));
759 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 75,25, 0,255,0,255));
762 ctx.translate(100, 0);
763 g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2);
764 g.addColorStop(0, '#0f0');g.addColorStop(0.5, '#0f0');
765 g.addColorStop(0.51, '#f00');
766 g.addColorStop(1, '#f00');
767 ctx.fillStyle = g;ctx.translate(-50, 25);
769 ctx.fillRect(-5, -2.5, 10, 5);
770 //verify(Helper.comparePixel(ctx, 25,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
771 //verify(Helper.comparePixel(ctx, 75,25, 0,255,0,255));
775 g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2);
776 g.addColorStop(0, '#0f0');
777 g.addColorStop(0.5, '#0f0');g.addColorStop(0.51, '#f00');
778 g.addColorStop(1, '#f00');
780 ctx.fillRect(0, 0, 100, 50);ctx.translate(50, 25);
782 ctx.fillRect(-5, -2.5, 10, 5);
783 //verify(Helper.comparePixel(ctx, 25,25, 0,255,0,255));//verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
784 //verify(Helper.comparePixel(ctx, 75,25, 0,255,0,255));
788 function test_linear() {
789 var ctx = canvas.getContext('2d');
791 try { var err = false;
792 ctx.createLinearGradient(Infinity, 0, 1, 0);
793 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); }
794 try { var err = false;
795 ctx.createLinearGradient(-Infinity, 0, 1, 0);
796 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); }
797 try { var err = false;
798 ctx.createLinearGradient(NaN, 0, 1, 0);
799 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); }
800 try { var err = false;
801 ctx.createLinearGradient(0, Infinity, 1, 0);
802 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); }
803 try { var err = false;
804 ctx.createLinearGradient(0, -Infinity, 1, 0);
805 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); }
806 try { var err = false;
807 ctx.createLinearGradient(0, NaN, 1, 0);
808 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); }
809 try { var err = false;
810 ctx.createLinearGradient(0, 0, Infinity, 0);
811 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); }
812 try { var err = false;
813 ctx.createLinearGradient(0, 0, -Infinity, 0);
814 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); }
815 try { var err = false;
816 ctx.createLinearGradient(0, 0, NaN, 0);
817 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); }
818 try { var err = false;
819 ctx.createLinearGradient(0, 0, 1, Infinity);
820 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); }
821 try { var err = false;
822 ctx.createLinearGradient(0, 0, 1, -Infinity);
823 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); }
824 try { var err = false;
825 ctx.createLinearGradient(0, 0, 1, NaN);
826 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); }
827 try { var err = false;
828 ctx.createLinearGradient(Infinity, Infinity, 1, 0);
829 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); }
830 try { var err = false;
831 ctx.createLinearGradient(Infinity, Infinity, Infinity, 0);
832 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); }
833 try { var err = false;
834 ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity);
835 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); }
836 try { var err = false;
837 ctx.createLinearGradient(Infinity, Infinity, 1, Infinity);
838 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); }
839 try { var err = false;
840 ctx.createLinearGradient(Infinity, 0, Infinity, 0);
841 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); }
842 try { var err = false;
843 ctx.createLinearGradient(Infinity, 0, Infinity, Infinity);
844 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); }
845 try { var err = false;
846 ctx.createLinearGradient(Infinity, 0, 1, Infinity);
847 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); }
848 try { var err = false;
849 ctx.createLinearGradient(0, Infinity, Infinity, 0);
850 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); }
851 try { var err = false;
852 ctx.createLinearGradient(0, Infinity, Infinity, Infinity);
853 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); }
854 try { var err = false;
855 ctx.createLinearGradient(0, Infinity, 1, Infinity);
856 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); }
857 try { var err = false;
858 ctx.createLinearGradient(0, 0, Infinity, Infinity);
859 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); }
862 var g = ctx.createLinearGradient(0, 0, 200, 0);
863 g.addColorStop(0, '#f00');
864 g.addColorStop(0.25, '#0f0');
865 g.addColorStop(0.75, '#0f0');
866 g.addColorStop(1, '#f00');
868 ctx.translate(-50, 0);
869 ctx.fillRect(50, 0, 100, 50);
870 verify(Helper.comparePixel(ctx, 25,25, 0,255,0,255));
871 verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
872 verify(Helper.comparePixel(ctx, 75,25, 0,255,0,255));
875 ctx.translate(100, 0);
876 g = ctx.createLinearGradient(0, 0, 200, 0);
877 g.addColorStop(0, '#f00');
878 g.addColorStop(0.25, '#0f0');
879 g.addColorStop(0.75, '#0f0');
880 g.addColorStop(1, '#f00');
882 ctx.translate(-150, 0);
883 ctx.fillRect(50, 0, 100, 50);
884 verify(Helper.comparePixel(ctx, 25,25, 0,255,0,255));
885 verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
886 verify(Helper.comparePixel(ctx, 75,25, 0,255,0,255));
890 g = ctx.createLinearGradient(0, 0, 200, 0);
891 g.addColorStop(0, '#f00');
892 g.addColorStop(0.25, '#0f0');
893 g.addColorStop(0.75, '#0f0');
894 g.addColorStop(1, '#f00');
896 ctx.fillRect(0, 0, 100, 50);
897 ctx.translate(-50, 0);
898 ctx.fillRect(50, 0, 100, 50);
899 verify(Helper.comparePixel(ctx, 25,25, 0,255,0,255));
900 verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
901 verify(Helper.comparePixel(ctx, 75,25, 0,255,0,255));
904 function test_object() {
905 var ctx = canvas.getContext('2d');
907 var g1 = ctx.createLinearGradient(0, 0, 100, 0);
908 var g2 = ctx.createLinearGradient(0, 0, 100, 0);
913 var g = ctx.createLinearGradient(0, 0, 100, 0);
914 try { var err = false;
915 g.addColorStop(0, "");
916 } catch (e) { if (e.code != DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); }
917 try { var err = false;
918 g.addColorStop(0, 'undefined');
919 } catch (e) { if (e.code != DOMException.SYNTAX_ERR) fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); }
923 g = ctx.createLinearGradient(0, 0, 100, 0);
924 try { var err = false;
925 g.addColorStop(-1, '#000');
926 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); }
927 try { var err = false;
928 g.addColorStop(2, '#000');
929 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); }
930 try { var err = false;
931 g.addColorStop(Infinity, '#000');
932 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); }
933 try { var err = false;
934 g.addColorStop(-Infinity, '#000');
935 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); }
936 try { var err = false;
937 g.addColorStop(NaN, '#000');
938 } catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); err = true; } finally { verify(err, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); }
942 g = ctx.createLinearGradient(-100, 0, 200, 0);
943 g.addColorStop(0, '#f00');
944 g.addColorStop(1, '#f00');
946 g.addColorStop(0.1, '#0f0');
947 g.addColorStop(0.9, '#0f0');
948 ctx.fillRect(0, 0, 100, 50);
949 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255,2));
952 ctx.fillStyle = '#0f0';
953 ctx.fillRect(0, 0, 100, 50);
955 g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100);
956 g.addColorStop(0, '#f00');
957 g.addColorStop(1, '#f00');
959 ctx.fillRect(0, 0, 100, 50);
961 //verify(Helper.comparePixel(ctx, 1,1, 0,255,0,255));
962 //verify(Helper.comparePixel(ctx, 50,1, 0,255,0,255));
963 //verify(Helper.comparePixel(ctx, 98,1, 0,255,0,255));
964 //verify(Helper.comparePixel(ctx, 1,25, 0,255,0,255,16));
965 //verify(Helper.comparePixel(ctx, 50,25, 0,255,0,255));
966 //verify(Helper.comparePixel(ctx, 98,25, 0,255,0,255));
967 //verify(Helper.comparePixel(ctx, 1,48, 0,255,0,255));
968 //verify(Helper.comparePixel(ctx, 50,48, 0,255,0,255));
969 //verify(Helper.comparePixel(ctx, 98,48, 0,255,0,255));
974 function test_conical() {
975 var ctx = canvas.getContext('2d');
977 var g = ctx.createConicalGradient(10, 10, 50);