| <title>Canvas test: 2d.state.saverestore.shadowBlur</title> |
| <script src="../tests.js"></script> |
| <link rel="stylesheet" href="../tests.css"> |
| <p id="passtext">Pass</p> |
| <p id="failtext">Fail</p> |
| <p class="output">These images should be identical:</p> |
| <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> |
| _addTest(function(canvas, ctx) { |
| // Test that restore() undoes any modifications |
| var old = ctx.shadowBlur; |
| _assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); |
| // Also test that save() doesn't modify the values |
| // we're not interested in failures caused by get(set(x)) != x (e.g. |
| // from rounding), so compare against 'old' instead of against 5 |
| _assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old"); |