browser/devtools/shadereditor/test/browser_webgl-actor-test-17.js

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

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 the blackbox/unblackbox operations work as expected with
michael@0 6 * overlapping geometry.
michael@0 7 */
michael@0 8
michael@0 9 function ifWebGLSupported() {
michael@0 10 let [target, debuggee, front] = yield initBackend(OVERLAPPING_GEOMETRY_CANVAS_URL);
michael@0 11 front.setup({ reload: true });
michael@0 12
michael@0 13 let [firstProgramActor, secondProgramActor] = yield getPrograms(front, 2);
michael@0 14
michael@0 15 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 16 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
michael@0 17 yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 18 ok(true, "The corner vs. center pixel colors are correct before blackboxing.");
michael@0 19
michael@0 20 yield firstProgramActor.blackbox();
michael@0 21 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 0, g: 0, b: 0, a: 255 }, true);
michael@0 22 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
michael@0 23 yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 0, g: 0, b: 0, a: 255 }, true);
michael@0 24 ok(true, "The corner vs. center pixel colors are correct after blackboxing (1).");
michael@0 25
michael@0 26 yield firstProgramActor.unblackbox();
michael@0 27 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 28 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
michael@0 29 yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 30 ok(true, "The corner vs. center pixel colors are correct after unblackboxing (1).");
michael@0 31
michael@0 32 yield secondProgramActor.blackbox();
michael@0 33 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 34 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 35 yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 36 ok(true, "The corner vs. center pixel colors are correct after blackboxing (2).");
michael@0 37
michael@0 38 yield secondProgramActor.unblackbox();
michael@0 39 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 40 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
michael@0 41 yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
michael@0 42 ok(true, "The corner vs. center pixel colors are correct after unblackboxing (2).");
michael@0 43
michael@0 44 yield removeTab(target.tab);
michael@0 45 finish();
michael@0 46 }

mercurial