https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 988503ce0658e4f1b072d76bfe34ebdc8336d028 authored by Luke Bjerring on 19 March 2018, 16:57:43 UTC
Handle options for add_untested_idls
Tip revision: 988503c
2d.state.saverestore.stack.worker.js
// DO NOT EDIT! This test has been generated by tools/gentest.py.
// OffscreenCanvas test in a worker:2d.state.saverestore.stack
// Description:save()/restore() can be nested as a stack
// Note:

importScripts("/resources/testharness.js");
importScripts("/common/canvas-tests.js");

var t = async_test("save()/restore() can be nested as a stack");
t.step(function() {

var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');

ctx.lineWidth = 1;
ctx.save();
ctx.lineWidth = 2;
ctx.save();
ctx.lineWidth = 3;
_assertSame(ctx.lineWidth, 3, "ctx.lineWidth", "3");
ctx.restore();
_assertSame(ctx.lineWidth, 2, "ctx.lineWidth", "2");
ctx.restore();
_assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1");

t.done();

});
done();
back to top