browser_webgl-actor-test-04.js 892 B

12345678910111213141516171819202122232425262728
  1. /* Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ */
  3. /**
  4. * Tests if a program actor is sent when WebGL programs are linked,
  5. * and that the corresponding vertex and fragment actors can be retrieved.
  6. */
  7. function* ifWebGLSupported() {
  8. let { target, front } = yield initBackend(SIMPLE_CANVAS_URL);
  9. front.setup({ reload: true });
  10. let programActor = yield once(front, "program-linked");
  11. ok(programActor,
  12. "A program actor was sent along with the 'program-linked' notification.");
  13. let vertexShader = yield programActor.getVertexShader();
  14. ok(programActor,
  15. "A vertex shader actor was retrieved from the program actor.");
  16. let fragmentShader = yield programActor.getFragmentShader();
  17. ok(programActor,
  18. "A fragment shader actor was retrieved from the program actor.");
  19. yield removeTab(target.tab);
  20. finish();
  21. }