github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

kig / canvas3d-tests

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 4
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • 104abe2a3404c2d3d521b3a66791f00162ca8184
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Tests for the OpenGL ES 2.0 canvas element — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

get rid of compatibility cruft 
kig (author)
Fri Jan 08 07:26:26 -0800 2010
commit  fbd01a4d37f5bd6f1f73ddec03ab8f2ca70369a6
tree    e68165b8e5268917c3cea84c4f5d30bea4e72d14
parent  cc7661be9054ded23c39f8e12b33c2e0420d0f1e
canvas3d-tests /
name age
history
message
file .gitignore Fri Mar 20 17:06:41 -0700 2009 .gitignore: baseline/bandwidth [Ilmari Heikkinen]
file LICENSE Sun Mar 08 03:10:10 -0700 2009 LICENSE information (MIT license) [Ilmari Heikkinen]
file PRIORITY_TESTS Fri Mar 20 17:19:57 -0700 2009 PRIORITY_TESTS update [Ilmari Heikkinen]
file README.md Loading commit data...
file all_tests.html Thu Dec 03 18:07:26 -0800 2009 all_tests update [kig]
file all_tests_linkonly.html
file all_tests_sequential.html Thu Dec 03 18:07:26 -0800 2009 all_tests update [kig]
directory apigen/ Sun Nov 29 06:21:00 -0800 2009 api_modifications: get*i -> get*Parameter [kig]
directory baseline/ Fri Mar 20 17:50:35 -0700 2009 bandwidth: do a dry run with texImage2D [Ilmari Heikkinen]
directory conformance/
file constants.txt Sun Nov 29 06:21:00 -0800 2009 api_modifications: get*i -> get*Parameter [kig]
directory demos/ Thu Dec 10 20:42:39 -0800 2009 opengl_web: initialize dof on first frame [kig]
directory functions/ Fri Jan 08 07:26:26 -0800 2010 get rid of compatibility cruft [Ilmari Heikkinen]
file gen_tests.rb
directory glsl/
file index.html Mon Nov 16 07:37:37 -0800 2009 index.html: move test purposes to top of document [kig]
file methods.txt Sun Nov 29 06:21:00 -0800 2009 api_modifications: get*i -> get*Parameter [kig]
directory performance/
file template.html Tue Mar 03 12:02:38 -0800 2009 performance/CPUvsGPU: gaussian blur in JS vs GL... [Ilmari Heikkinen]
file test_server.rb Sun Mar 22 07:38:38 -0700 2009 test_server.rb: don't unescape data to keep ter... [Ilmari Heikkinen]
file unit.css
file unit.js Thu Jan 07 04:11:04 -0800 2010 unit.js: do test notify in try-block [Ilmari Heikkinen]
file util.js
README.md

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:

  • Planet WebGL
  • Learning WebGL
  • WebGL on Khronos Message Boards

Developer links:

  • WebGL on Mozilla Bugzilla
  • WebGL on WebKit Bugzilla
  • WebGL on Chromium Bugzilla

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.

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server