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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/shadereditor/test/browser_webgl-actor-test-17.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +/**
     1.8 + * Tests that the blackbox/unblackbox operations work as expected with
     1.9 + * overlapping geometry.
    1.10 + */
    1.11 +
    1.12 +function ifWebGLSupported() {
    1.13 +  let [target, debuggee, front] = yield initBackend(OVERLAPPING_GEOMETRY_CANVAS_URL);
    1.14 +  front.setup({ reload: true });
    1.15 +
    1.16 +  let [firstProgramActor, secondProgramActor] = yield getPrograms(front, 2);
    1.17 +
    1.18 +  yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.19 +  yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
    1.20 +  yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.21 +  ok(true, "The corner vs. center pixel colors are correct before blackboxing.");
    1.22 +
    1.23 +  yield firstProgramActor.blackbox();
    1.24 +  yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 0, g: 0, b: 0, a: 255 }, true);
    1.25 +  yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
    1.26 +  yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 0, g: 0, b: 0, a: 255 }, true);
    1.27 +  ok(true, "The corner vs. center pixel colors are correct after blackboxing (1).");
    1.28 +
    1.29 +  yield firstProgramActor.unblackbox();
    1.30 +  yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.31 +  yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
    1.32 +  yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.33 +  ok(true, "The corner vs. center pixel colors are correct after unblackboxing (1).");
    1.34 +
    1.35 +  yield secondProgramActor.blackbox();
    1.36 +  yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.37 +  yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.38 +  yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.39 +  ok(true, "The corner vs. center pixel colors are correct after blackboxing (2).");
    1.40 +
    1.41 +  yield secondProgramActor.unblackbox();
    1.42 +  yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.43 +  yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 255, b: 255, a: 255 }, true);
    1.44 +  yield ensurePixelIs(debuggee, { x: 127, y: 127 }, { r: 255, g: 255, b: 0, a: 255 }, true);
    1.45 +  ok(true, "The corner vs. center pixel colors are correct after unblackboxing (2).");
    1.46 +
    1.47 +  yield removeTab(target.tab);
    1.48 +  finish();
    1.49 +}

mercurial