summaryrefslogtreecommitdiffstats
path: root/devtools/client/shadereditor/test/browser_webgl-actor-test-04.js
blob: 4256a5329784cd0161bff1f53b87f384ffdf243d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

/**
 * Tests if a program actor is sent when WebGL programs are linked,
 * and that the corresponding vertex and fragment actors can be retrieved.
 */

function* ifWebGLSupported() {
  let { target, front } = yield initBackend(SIMPLE_CANVAS_URL);
  front.setup({ reload: true });

  let programActor = yield once(front, "program-linked");
  ok(programActor,
    "A program actor was sent along with the 'program-linked' notification.");

  let vertexShader = yield programActor.getVertexShader();
  ok(programActor,
    "A vertex shader actor was retrieved from the program actor.");

  let fragmentShader = yield programActor.getFragmentShader();
  ok(programActor,
    "A fragment shader actor was retrieved from the program actor.");

  yield removeTab(target.tab);
  finish();
}