You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
Many of the tests which are generated programmatically report results before any assertions are made. The tests' "template" code defines a single subtest:
Although declared using the
async_test
API, the invocation of thet.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 thet.step_func
method (otherwise, test failures will be reported as harness errors)./cc @AmeliaBR @annevk @kenrussell @fserb
The text was updated successfully, but these errors were encountered: