Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / canvas / test / test_2d.gradient.object.invalidoffset.html
blob3b504c93178edce792c6db3846bd1cd79640bae2
1 <!DOCTYPE HTML>
2 <title>Canvas test: 2d.gradient.object.invalidoffset</title>
3 <script src="/MochiKit/MochiKit.js"></script>
4 <script src="/tests/SimpleTest/SimpleTest.js"></script>
5 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
6 <body>
7 <canvas id="c" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
8 <script>
10 SimpleTest.waitForExplicitFinish();
11 MochiKit.DOM.addLoadEvent(function () {
13 var canvas = document.getElementById('c');
14 var ctx = canvas.getContext('2d');
16 var g = ctx.createLinearGradient(0, 0, 100, 0);
17 var _thrown = undefined; try {
18 g.addColorStop(-1, '#000');
19 } catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
20 var _thrown = undefined; try {
21 g.addColorStop(2, '#000');
22 } catch (e) { _thrown = e }; ok(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
23 var _thrown = undefined; try {
24 g.addColorStop(Infinity, '#000');
25 } catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
26 var _thrown = undefined; try {
27 g.addColorStop(-Infinity, '#000');
28 } catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
29 var _thrown = undefined; try {
30 g.addColorStop(NaN, '#000');
31 } catch (e) { _thrown = e }; todo(_thrown && _thrown.code == DOMException.INDEX_SIZE_ERR, "should throw INDEX_SIZE_ERR");
33 SimpleTest.finish();
35 });
36 </script>