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