Closed Bug 1054576 Opened 10 years ago Closed 8 years ago

Run entire WebGL conformance suite in Workers with WorkerCanvas

Categories

(Core :: Graphics, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jmorton, Unassigned)

References

Details

Attachments

(2 files)

The WebGL conformance suite as it is currently written is very far from being able to run in workers:
 - every test is an html file instead of a plain script
 - many tests use main-thread-only features in window/document.
 - tests make heavy use of eval'd strings that expect variables in the global scope, which is a huge problem for callback-based messaging that WorkerCanvas requires
 - canvas usage is inconsistent: tests use 0, 1, or more canvases which are either included in the html or created dynamically
 - many of the shaders are included as <script>s

We want to test WorkerCanvas (tracked in bug 709490) for conformant behavior with the suite, though... but it would be a huge effort to make the suite support main thread and worker operation simultaneously. In the interest of time, I've been working on a script which ports the suite test files, taking care of most of these issues automatically and writing the tests as js files to be executed in a worker.

The ported suite also requires extensive patches to the testing libraries themselves.

I will be attaching both the fully ported suite (with the library modifications) and the script that was used to create the tests.

At this point, most of the tests pass, but it's not at 100% yet. In particular, these tests don't work:
 - HTMLCanvasElement features not implemented in WorkerCanvas (toDataURL, toBlob, texImage2D)
 - Tests that depend on certain DOM manipulations
 - Extra tests in the more/ directory that depend on an entirely different testing library that I haven't ported
 - Tests that use 2D canvases to verify behavior (no 2D canvas on workers!)
Blocks: 709490
Conversion script
This is the ported version of the conformance suite that has been created by copying the webgl-conformance directory, modifying many of the testing library files, and some of the mochitest files, and then running the test conversion script on the original conformance suite with output set to the new directory.
So...this is literally changing now in bug 1052240. Luckily, it sounds like we're messing with different parts of the system.

However, since WebGL-in-Workers is part of the spec (or going to be), we actually be changing the upstream conformance suites to be better suited to being run both within workers and without.

Let's talk design before writing a bunch of patches against upstream, though.
OK, so given the issues I mentioned above, changing upstream to support workers simultaneously would require what is essentially a complete rewrite of the entire suite; the diff would touch every single line.

In particular, the tests themselves have be rewritten as javascript files. I suppose then we can have the mochitest html files for the non-worker case that wrap the "unit" js files, which I think is a strategy we use elsewhere for xpcshell?
Let's officially shelve this. We can revive this discussion later, if desired.
Severity: normal → minor
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: