chromium/third_party/blink/web_tests/external/wpt/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js

// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
// OffscreenCanvas test in a worker:2d.pattern.basic.type
// Description:
// Note:

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

promise_test(async t => {
  var canvas = new OffscreenCanvas(100, 50);
  var ctx = canvas.getContext('2d');

  _assertDifferent(self.CanvasPattern, undefined, "self.CanvasPattern", "undefined");

  self.CanvasPattern.prototype.thisImplementsCanvasPattern = true;

  var response = await fetch('/images/green.png')
  var blob = await response.blob();
  var img = await createImageBitmap(blob);
  var pattern = ctx.createPattern(img, 'no-repeat');
  _assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern");
}, "");
done();