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

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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

mercurial