Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Tests if blackboxing a program works properly in tandem with blended
6 * overlapping geometry.
7 */
9 function ifWebGLSupported() {
10 let [target, debuggee, panel] = yield initShaderEditor(BLENDED_GEOMETRY_CANVAS_URL);
11 let { gFront, EVENTS, ShadersListView, ShadersEditorsView } = panel.panelWin;
13 reload(target);
14 let [[firstProgramActor, secondProgramActor]] = yield promise.all([
15 getPrograms(gFront, 2),
16 once(panel.panelWin, EVENTS.SOURCES_SHOWN)
17 ]);
19 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 127, g: 127, b: 127, a: 255 }, true);
20 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 127, b: 127, a: 127 }, true);
21 ok(true, "The canvas was correctly drawn.");
23 getBlackBoxCheckbox(panel, 0).click();
25 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 0, g: 0, b: 0, a: 255 }, true);
26 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 0, b: 0, a: 127 }, true);
27 ok(true, "The first program was correctly blackboxed.");
29 getBlackBoxCheckbox(panel, 0).click();
30 getBlackBoxCheckbox(panel, 1).click();
32 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 127, g: 127, b: 127, a: 255 }, true);
33 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 127, g: 127, b: 127, a: 255 }, true);
34 ok(true, "The second program was correctly blackboxed.");
36 getBlackBoxCheckbox(panel, 1).click();
38 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 127, g: 127, b: 127, a: 255 }, true);
39 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 127, b: 127, a: 127 }, true);
40 ok(true, "The two programs were correctly unblackboxed.");
42 getBlackBoxCheckbox(panel, 0).click();
43 getBlackBoxCheckbox(panel, 1).click();
45 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 0, g: 0, b: 0, a: 255 }, true);
46 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 0, b: 0, a: 255 }, true);
47 ok(true, "The two programs were correctly blackboxed again.");
49 getBlackBoxCheckbox(panel, 0).click();
50 getBlackBoxCheckbox(panel, 1).click();
52 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 127, g: 127, b: 127, a: 255 }, true);
53 yield ensurePixelIs(debuggee, { x: 64, y: 64 }, { r: 0, g: 127, b: 127, a: 127 }, true);
54 ok(true, "The two programs were correctly unblackboxed again.");
56 yield teardown(panel);
57 finish();
58 }
60 function getBlackBoxCheckbox(aPanel, aIndex) {
61 return aPanel.panelWin.document.querySelectorAll(
62 ".side-menu-widget-item-checkbox")[aIndex];
63 }