gecko/content/canvas/test/webgl/more
2010-12-03 14:44:01 -08:00
..
conformance Update in-tree WebGL test suite to r12629 2010-10-09 12:44:24 -07:00
demos Bug 590729 - Update WebGL tests to upstream r12308, and Mochitest improvements - r=vladimir, a=blocking2.0 2010-08-25 19:09:26 -04:00
functions Bug 592416 - Various WebGL fixes - r=vladimir 2010-09-02 10:38:26 -04:00
glsl Bug 590729 - Update WebGL tests to upstream r12308, and Mochitest improvements - r=vladimir, a=blocking2.0 2010-08-25 19:09:26 -04:00
performance Bug 590729 - Update WebGL tests to upstream r12308, and Mochitest improvements - r=vladimir, a=blocking2.0 2010-08-25 19:09:26 -04:00
00_test_list.txt Update in-tree WebGL test suite to r12629 2010-10-09 12:44:24 -07:00
00_testFIXME_list.txt Bug 590729 - Update WebGL tests to upstream r12308, and Mochitest improvements - r=vladimir, a=blocking2.0 2010-08-25 19:09:26 -04:00
all_tests_linkonly.html b=578509; Update our copy of the WebGL conformance test suite to svn 11955; r=vladimir 2010-07-16 10:30:32 -04:00
all_tests_sequential.html b=578509; Update our copy of the WebGL conformance test suite to svn 11955; r=vladimir 2010-07-16 10:30:32 -04:00
all_tests.html b=578509; Update our copy of the WebGL conformance test suite to svn 11955; r=vladimir 2010-07-16 10:30:32 -04:00
index.html b=578509; Update our copy of the WebGL conformance test suite to svn 11955; r=vladimir 2010-07-16 10:30:32 -04:00
README.md b=578509; Update our copy of the WebGL conformance test suite to svn 11955; r=vladimir 2010-07-16 10:30:32 -04:00
unit.css b=578509; Update our copy of the WebGL conformance test suite to svn 11955; r=vladimir 2010-07-16 10:30:32 -04:00
unit.js Update in-tree WebGL test suite to r12629 2010-10-09 12:44:24 -07:00
util.js update in-tree webgl conformance tests copy; r=npotb 2010-12-03 14:44:01 -08:00

Tests for the WebGL canvas context

These tests are intended to serve the following purposes:

  • Assert spec conformance
  • Check the safety of the GL binding (bounds checking, same origin policy)
  • Provide performance numbers for developers

Running the tests

  1. Install a browser with WebGL support
  2. Run ruby gen_tests.rb if you have modified the tests.
  3. Run ruby test_server.rb if you want to get test run output to test_server's stdout (especially useful for finding out which test crashed your browser.)
  4. Open all_tests.html in your browser.

Want to contribute?

  1. Fork this repo
  2. Run gen_tests.rb
  3. Look into templates/ to see which functions lack tests (also see methods.txt and nsICanvasRenderingContextWebGL.idl): 1. copy methodName.html to functions/methodName.html and write tests that test the results of valid inputs. 2. copy methodNameBadArgs.html to functions/methodNameBadArgs.html and write tests to assert that invalid inputs throw exceptions. 3. If your test causes a segfault, add the following to the top of the script tag: Tests.autorun = false; Tests.message = "Caution: this may crash your browser";
  4. For each performance test: 1. Write a performance/myTestName.html and set Tests.autorun = false;
  5. If you have a test that you would like to run over the whole API or want to generate tests programmatically, add them to gen_tests.rb or write your own script.
  6. Create a commit for each file. (E.g. for f in $(git status | grep -e "^#\sfunctions/\S$" | sed "s/^#\s*//"); do git add $f; git commit -m $f; done)
  7. Send me a pull request.
  8. Congratulations, you're now a contributor!

For more information on WebGL:

Developer links:

What's the stuff in apigen?

There are some Python scripts in the apigen/ directory that generate C++ based on the API definition files (gl2.h, api_modifications.txt, valid_args.txt.) The generated code is Mozilla XPCOM functions that check their args against the valid GLES 2.0 constants (as they were written on the man pages.) There's also some wackier stuff for checking copyTexImage2D and copyTexSubImage2D image dimensions against viewport dimensions.

If you can use it to generate code for your WebGL implementation, it might save you 1500 lines of typing and testing. The last time I used it was summer 2009 to generate a patch for Canvas 3D, so it's likely somewhat out of date.