-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Many of the tests which are generated programmatically report results before any assertions are made. The tests' "template" code defines a single subtest:
var t = async_test("%(escaped_desc)s");
t.step(function() {
var offscreenCanvas = new OffscreenCanvas(100, 50);
var ctx = offscreenCanvas.getContext('2d');
%(code)s
t.done();
});
Although declared using the async_test API, the invocation of the t.done method in the test body makes these tests fully synchronous. However, many of the code excerpts used to expand this template include asynchronous operations, e.g. compositing/2d.composite.canvas.copy.html
In the absence of additional subtests, asynchronous code cannot influence the results reported by testharness.js.
There are many ways this could be addressed, but the most straightforward may be to relocate the invocation of t.done from the template and into each of the code excerpts. This would also be a good opportunity to wrap asynchronously-executed functions with the t.step_func method (otherwise, test failures will be reported as harness errors).