// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. // OffscreenCanvas test in a worker:2d.state.saverestore.miterLimit // Description: // Note: importScripts("/resources/testharness.js"); importScripts("/html/canvas/resources/canvas-tests.js"); test(t => { const canvas = new OffscreenCanvas(300, 150); const ctx = canvas.getContext('2d'); const old = ctx.miterLimit; ctx.save(); ctx.miterLimit = 0.5; ctx.restore(); _assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); }, "save()/restore() restores miterLimit, for a canvas of size (300, 150)."); test(t => { const canvas = new OffscreenCanvas(300, 150); const ctx = canvas.getContext('2d'); ctx.miterLimit = 0.5; const old = ctx.miterLimit; // We're not interested in failures caused by get(set(x)) != x (e.g. // from rounding), so compare against `old` instead of 0.5. ctx.save(); _assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); ctx.restore(); }, "save() does not modify miterLimit, for a canvas of size (300, 150)."); test(t => { const canvas = new OffscreenCanvas(0, 0); const ctx = canvas.getContext('2d'); const old = ctx.miterLimit; ctx.save(); ctx.miterLimit = 0.5; ctx.restore(); _assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); }, "save()/restore() restores miterLimit, for a canvas of size (0, 0)."); test(t => { const canvas = new OffscreenCanvas(0, 0); const ctx = canvas.getContext('2d'); ctx.miterLimit = 0.5; const old = ctx.miterLimit; // We're not interested in failures caused by get(set(x)) != x (e.g. // from rounding), so compare against `old` instead of 0.5. ctx.save(); _assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old"); ctx.restore(); }, "save() does not modify miterLimit, for a canvas of size (0, 0)."); done();