Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[offscreen-canvas] Procedurally-generated tests are invalid #20180

Closed
jugglinmike opened this issue Nov 8, 2019 · 0 comments
Closed

[offscreen-canvas] Procedurally-generated tests are invalid #20180

jugglinmike opened this issue Nov 8, 2019 · 0 comments
Assignees

Comments

@jugglinmike
Copy link
Contributor

@jugglinmike jugglinmike commented Nov 8, 2019

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).

/cc @AmeliaBR @annevk @kenrussell @fserb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.