test_webgl_constant_vendor_fpp_explicit.html (1609B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>WebGL Constant Vendor with FPP (explicit) - Vendor should be constant "Mozilla"</title> 4 <script src="/tests/SimpleTest/SimpleTest.js"></script> 5 <script> 6 /* global SimpleTest SpecialPowers */ 7 SimpleTest.waitForExplicitFinish(); 8 document.addEventListener("DOMContentLoaded", async function() { 9 // Enable FPP with explicit -AllTargets,+WebGLVendorConstant 10 // This ensures only WebGLVendorConstant is active, nothing else 11 await SpecialPowers.pushPrefEnv({ 12 set: [ 13 ["privacy.fingerprintingProtection", true], 14 ["privacy.fingerprintingProtection.overrides", "-AllTargets,+WebGLVendorConstant"], 15 ["privacy.resistFingerprinting", false] 16 ] 17 }); 18 19 let canvas = document.body.appendChild(document.createElement("canvas")); 20 if (!canvas) { 21 SimpleTest.ok(false, "Cannot create canvas"); 22 SimpleTest.finish(); 23 return; 24 } 25 26 let gl = canvas.getContext("webgl"); 27 if (!gl) { 28 SimpleTest.ok(false, "Cannot get WebGL context"); 29 SimpleTest.finish(); 30 return; 31 } 32 33 // Try to get the WEBGL_debug_renderer_info extension 34 let ext = gl.getExtension("WEBGL_debug_renderer_info"); 35 if (!ext) { 36 SimpleTest.ok(false, "WEBGL_debug_renderer_info extension should be available with FPP"); 37 SimpleTest.finish(); 38 return; 39 } 40 41 // With FPP and WebGLVendorConstant enabled, the vendor should be "Mozilla" 42 let vendor = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL); 43 SimpleTest.is(vendor, "Mozilla", "UNMASKED_VENDOR_WEBGL should be constant 'Mozilla' with WebGLVendorConstant enabled"); 44 45 SimpleTest.finish(); 46 }); 47 </script>