browser/devtools/shadereditor/test/browser_se_programs-cache.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 /**
michael@0 5 * Tests that program and shader actors are cached in the frontend.
michael@0 6 */
michael@0 7
michael@0 8 function ifWebGLSupported() {
michael@0 9 let [target, debuggee, panel] = yield initShaderEditor(MULTIPLE_CONTEXTS_URL);
michael@0 10 let { EVENTS, gFront, ShadersListView, ShadersEditorsView } = panel.panelWin;
michael@0 11
michael@0 12 reload(target);
michael@0 13 let [[programActor]] = yield promise.all([
michael@0 14 getPrograms(gFront, 1),
michael@0 15 once(panel.panelWin, EVENTS.SOURCES_SHOWN)
michael@0 16 ]);
michael@0 17
michael@0 18 let programItem = ShadersListView.selectedItem;
michael@0 19
michael@0 20 is(programItem.attachment.programActor, programActor,
michael@0 21 "The correct program actor is cached for the selected item.");
michael@0 22
michael@0 23 is((yield programActor.getVertexShader()),
michael@0 24 (yield programItem.attachment.vs),
michael@0 25 "The cached vertex shader promise returns the correct actor.");
michael@0 26
michael@0 27 is((yield programActor.getFragmentShader()),
michael@0 28 (yield programItem.attachment.fs),
michael@0 29 "The cached fragment shader promise returns the correct actor.");
michael@0 30
michael@0 31 is((yield (yield programActor.getVertexShader()).getText()),
michael@0 32 (yield (yield ShadersEditorsView._getEditor("vs")).getText()),
michael@0 33 "The cached vertex shader promise returns the correct text.");
michael@0 34
michael@0 35 is((yield (yield programActor.getFragmentShader()).getText()),
michael@0 36 (yield (yield ShadersEditorsView._getEditor("fs")).getText()),
michael@0 37 "The cached fragment shader promise returns the correct text.");
michael@0 38
michael@0 39 yield teardown(panel);
michael@0 40 finish();
michael@0 41 }

mercurial