browser/devtools/shadereditor/test/browser_se_editors-contents.js

branch
TOR_BUG_9701
changeset 11
deefc01c0e14
equal deleted inserted replaced
-1:000000000000 0:eff65c89402e
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 /**
5 * Tests if the editors contain the correct text when a program
6 * becomes available.
7 */
8
9 function ifWebGLSupported() {
10 let [target, debuggee, panel] = yield initShaderEditor(SIMPLE_CANVAS_URL);
11 let { gFront, ShadersEditorsView, EVENTS } = panel.panelWin;
12
13 reload(target);
14 yield promise.all([
15 once(gFront, "program-linked"),
16 once(panel.panelWin, EVENTS.SOURCES_SHOWN)
17 ]);
18
19 let vsEditor = yield ShadersEditorsView._getEditor("vs");
20 let fsEditor = yield ShadersEditorsView._getEditor("fs");
21
22
23 is(vsEditor.getText().indexOf("gl_Position"), 170,
24 "The vertex shader editor contains the correct text.");
25 is(fsEditor.getText().indexOf("gl_FragColor"), 97,
26 "The fragment shader editor contains the correct text.");
27
28 yield teardown(panel);
29 finish();
30 }

mercurial