michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /** michael@0: * Tests if the editors contain the correct text when a program michael@0: * becomes available. michael@0: */ michael@0: michael@0: function ifWebGLSupported() { michael@0: let [target, debuggee, panel] = yield initShaderEditor(SIMPLE_CANVAS_URL); michael@0: let { gFront, ShadersEditorsView, EVENTS } = panel.panelWin; michael@0: michael@0: reload(target); michael@0: yield promise.all([ michael@0: once(gFront, "program-linked"), michael@0: once(panel.panelWin, EVENTS.SOURCES_SHOWN) michael@0: ]); michael@0: michael@0: let vsEditor = yield ShadersEditorsView._getEditor("vs"); michael@0: let fsEditor = yield ShadersEditorsView._getEditor("fs"); michael@0: michael@0: michael@0: is(vsEditor.getText().indexOf("gl_Position"), 170, michael@0: "The vertex shader editor contains the correct text."); michael@0: is(fsEditor.getText().indexOf("gl_FragColor"), 97, michael@0: "The fragment shader editor contains the correct text."); michael@0: michael@0: yield teardown(panel); michael@0: finish(); michael@0: }