Backed out changeset 713114c0331a (bug 1938707) by developer request CLOSED TREE
[gecko.git] / dom / canvas / test / webgl-mochitest / test_webgl_fingerprinting_resistance.html
blob99f81cb7e125bbe3cabc7b3e4fa18fe10fdda071
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <script src="/tests/SimpleTest/SimpleTest.js"></script>
4 <script>
5 /* global SimpleTest SpecialPowers */
6 SimpleTest.waitForExplicitFinish();
7 document.addEventListener("DOMContentLoaded", async function() {
8 await SpecialPowers.pushPrefEnv({
9 set: [
10 ["privacy.resistFingerprinting", true]
12 });
14 let canvas = document.body.appendChild(document.createElement("canvas"));
15 if (!canvas) {
16 SimpleTest.ok(false, "Cannot create canvas");
17 SimpleTest.finish();
20 let gl = canvas.getContext("webgl");
21 if (!gl) {
22 SimpleTest.ok(false, "Cannot get WebGL context");
23 SimpleTest.finish();
26 SimpleTest.is(gl.getParameter(gl.MAX_TEXTURE_SIZE), 2048, "MAX_TEXTURE_SIZE");
27 SimpleTest.is(gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE), 2048, "MAX_CUBE_MAP_TEXTURE_SIZE");
28 SimpleTest.is(gl.getParameter(gl.MAX_RENDERBUFFER_SIZE), 2048, "MAX_RENDERBUFFER_SIZE");
29 SimpleTest.is(gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS), 8, "MAX_VERTEX_TEXTURE_IMAGE_UNITS");
30 SimpleTest.is(gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS), 8, "MAX_TEXTURE_IMAGE_UNITS");
31 SimpleTest.is(gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS), 16, "MAX_COMBINED_TEXTURE_IMAGE_UNITS");
32 SimpleTest.is(gl.getParameter(gl.MAX_VERTEX_ATTRIBS), 16, "MAX_VERTEX_ATTRIBS");
33 SimpleTest.is(gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS), 256, "MAX_VERTEX_UNIFORM_VECTORS");
34 SimpleTest.is(gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS), 224, "MAX_FRAGMENT_UNIFORM_VECTORS");
35 SimpleTest.is(gl.getParameter(gl.MAX_VARYING_VECTORS), 8, "MAX_VARYING_VECTORS");
36 let viewportDims = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
37 SimpleTest.is(viewportDims[0], 4096, "MAX_VIEWPORT_DIMS[0]");
38 SimpleTest.is(viewportDims[1], 4096, "MAX_VIEWPORT_DIMS[1]");
39 let aliasedPointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);
40 SimpleTest.is(aliasedPointSizeRange[0], 1, "ALIASED_POINT_SIZE_RANGE[0]");
41 SimpleTest.is(aliasedPointSizeRange[1], 63, "ALIASED_POINT_SIZE_RANGE[1]");
42 let aliasedLineWIdthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE);
43 SimpleTest.is(aliasedLineWIdthRange[0], 1, "ALIASED_LINE_WIDTH_RANGE[0]");
44 SimpleTest.is(aliasedLineWIdthRange[1], 1, "ALIASED_LINE_WIDTH_RANGE[1]");
45 SimpleTest.finish();
46 });
47 </script>