Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
<!DOCTYPE html>
<meta charset="utf-8">
<title>WebGL Constant Vendor with FPP - Vendor should be constant "Mozilla"</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script>
/* global SimpleTest SpecialPowers */
SimpleTest.waitForExplicitFinish();
document.addEventListener("DOMContentLoaded", async function() {
// Enable FPP with WebGLVendorConstant
await SpecialPowers.pushPrefEnv({
set: [
["privacy.fingerprintingProtection", true],
["privacy.fingerprintingProtection.overrides", "+WebGLVendorConstant"],
["privacy.resistFingerprinting", false]
]
});
let canvas = document.body.appendChild(document.createElement("canvas"));
if (!canvas) {
SimpleTest.ok(false, "Cannot create canvas");
SimpleTest.finish();
return;
}
let gl = canvas.getContext("webgl");
if (!gl) {
SimpleTest.ok(false, "Cannot get WebGL context");
SimpleTest.finish();
return;
}
// Try to get the WEBGL_debug_renderer_info extension
let ext = gl.getExtension("WEBGL_debug_renderer_info");
if (!ext) {
SimpleTest.ok(false, "WEBGL_debug_renderer_info extension should be available with FPP");
SimpleTest.finish();
return;
}
// With FPP and WebGLVendorConstant enabled, the vendor should be "Mozilla"
let vendor = gl.getParameter(ext.UNMASKED_VENDOR_WEBGL);
SimpleTest.is(vendor, "Mozilla", "UNMASKED_VENDOR_WEBGL should be constant 'Mozilla' with WebGLVendorConstant enabled");
SimpleTest.finish();
});
</script>