OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <title>Canvas test: 2d.imageData.create2.nonfinite</title> | |
3 <script src="../tests.js"></script> | |
4 <link rel="stylesheet" href="../tests.css"> | |
5 <body> | |
6 <p id="passtext">Pass</p> | |
7 <p id="failtext">Fail</p> | |
8 <p class="output">These images should be identical:</p> | |
9 <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (
fallback content)</p></canvas> | |
10 | |
11 <ul id="d"></ul> | |
12 <script> | |
13 _addTest(function(canvas, ctx) { | |
14 | |
15 try { var _thrown = false; | |
16 ctx.createImageData(Infinity, 10); | |
17 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(Infinity, 10)"); } | |
18 try { var _thrown = false; | |
19 ctx.createImageData(-Infinity, 10); | |
20 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(-Infinity, 10)"); } | |
21 try { var _thrown = false; | |
22 ctx.createImageData(NaN, 10); | |
23 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(NaN, 10)"); } | |
24 try { var _thrown = false; | |
25 ctx.createImageData(10, Infinity); | |
26 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(10, Infinity)"); } | |
27 try { var _thrown = false; | |
28 ctx.createImageData(10, -Infinity); | |
29 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(10, -Infinity)"); } | |
30 try { var _thrown = false; | |
31 ctx.createImageData(10, NaN); | |
32 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(10, NaN)"); } | |
33 try { var _thrown = false; | |
34 ctx.createImageData(Infinity, Infinity); | |
35 } catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assert
ion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown =
true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED
_ERR: ctx.createImageData(Infinity, Infinity)"); } | |
36 | |
37 | |
38 }); | |
39 </script> | |
40 | |
OLD | NEW |