chromium/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/canvas-context/2d.canvas.context.type.prototype.worker.js

// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.canvas.context.type.prototype
// Description:window.CanvasRenderingContext2D.prototype are not [[Writable]] and not [[Configurable]], and its methods are [[Configurable]].
// Note:<p class="notes">Defined in "Web IDL" (draft)

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

var t = async_test("window.CanvasRenderingContext2D.prototype are not [[Writable]] and not [[Configurable]], and its methods are [[Configurable]].");
var t_pass = t.done.bind(t);
var t_fail = t.step_func(function(reason) {
    throw reason;
});
t.step(function() {

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

  _assert(self.OffscreenCanvasRenderingContext2D.prototype, "self.OffscreenCanvasRenderingContext2D.prototype");
  _assert(self.OffscreenCanvasRenderingContext2D.prototype.fill, "self.OffscreenCanvasRenderingContext2D.prototype.fill");
  self.OffscreenCanvasRenderingContext2D.prototype = null;
  _assert(self.OffscreenCanvasRenderingContext2D.prototype, "self.OffscreenCanvasRenderingContext2D.prototype");
  delete self.OffscreenCanvasRenderingContext2D.prototype;
  _assert(self.OffscreenCanvasRenderingContext2D.prototype, "self.OffscreenCanvasRenderingContext2D.prototype");
  self.OffscreenCanvasRenderingContext2D.prototype.fill = 1;
  _assertSame(self.OffscreenCanvasRenderingContext2D.prototype.fill, 1, "self.OffscreenCanvasRenderingContext2D.prototype.fill", "1");
  delete self.OffscreenCanvasRenderingContext2D.prototype.fill;
  _assertSame(self.OffscreenCanvasRenderingContext2D.prototype.fill, undefined, "self.OffscreenCanvasRenderingContext2D.prototype.fill", "undefined");
  t.done();
});
done();