Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /**
5 * Tests if the WebGL context is correctly instrumented every time the
6 * target navigates.
7 */
9 function ifWebGLSupported() {
10 let [target, debuggee, front] = yield initBackend(SIMPLE_CANVAS_URL);
12 front.setup({ reload: true });
13 yield testHighlighting((yield once(front, "program-linked")));
14 ok(true, "Canvas was correctly instrumented on the first navigation.");
16 reload(target);
17 yield testHighlighting((yield once(front, "program-linked")));
18 ok(true, "Canvas was correctly instrumented on the second navigation.");
20 reload(target);
21 yield testHighlighting((yield once(front, "program-linked")));
22 ok(true, "Canvas was correctly instrumented on the third navigation.");
24 yield removeTab(target.tab);
25 finish();
27 function testHighlighting(programActor) {
28 return Task.spawn(function() {
29 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 0, b: 0, a: 255 }, true);
30 yield ensurePixelIs(debuggee, { x: 511, y: 511 }, { r: 0, g: 255, b: 0, a: 255 }, true);
31 ok(true, "The corner pixel colors are correct before highlighting.");
33 yield programActor.highlight([0, 1, 0, 1]);
34 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 0, g: 0, b: 0, a: 255 }, true);
35 yield ensurePixelIs(debuggee, { x: 511, y: 511 }, { r: 0, g: 255, b: 0, a: 255 }, true);
36 ok(true, "The corner pixel colors are correct after highlighting.");
38 yield programActor.unhighlight();
39 yield ensurePixelIs(debuggee, { x: 0, y: 0 }, { r: 255, g: 0, b: 0, a: 255 }, true);
40 yield ensurePixelIs(debuggee, { x: 511, y: 511 }, { r: 0, g: 255, b: 0, a: 255 }, true);
41 ok(true, "The corner pixel colors are correct after unhighlighting.");
42 });
43 }
44 }