Files
firefox/testing/web-platform/tests/reporting/resources/worker-trigger-deprecation.https.sub.js
Simon Farre d515e36181 Bug 2013863 Part 3: Add WPT for Worker triggering & sending report r=smaug
This test triggers a deprecation report in a Worker and expects to be
able to see that report having been sent.

Differential Revision: https://phabricator.services.mozilla.com/D281637
2026-02-19 01:41:48 +00:00

15 lines
416 B
JavaScript

importScripts("{{location[server]}}/resources/testharness.js");
async_test(function(t) {
const observer = new ReportingObserver(t.step_func_done((reports) => {
done();
}));
observer.observe();
const off = new OffscreenCanvas(1, 1);
const ctx = off.getContext("2d");
ctx.fillRect(0, 0, 1, 1);
// Trigger deprecation
off.toBlob().then(() => {});
}, "Worker should trigger a deprecation report");