blob: 262bd2f99e15d315a7b378d8e605c3689362e706 [file] [log] [blame]
<script>
if (window.testRunner)
window.testRunner.dumpAsText();
function getContext(name) {
var c = document.createElement("canvas");
return c.getContext(name);
}
function run() {
var output;
output = document.getElementById("output1");
if (!window.testRunner) {
output.textContent = "This test only runs inside DRT/WKTR.";
return;
}
window.internals.settings.setWebGL2Enabled(true);
var ctx = getContext("webgl2");
if (ctx)
output.textContent = "PASS: WebGL 2.0 was available when enabled.";
else
output.textContent = "FAIL: WebGL 2.0 was not available when enabled.";
output = document.getElementById("output2");
window.internals.settings.setWebGL2Enabled(false);
var ctx = getContext("webgl2");
if (ctx)
output.textContent = "FAIL: WebGL 2.0 was available when disabled.";
else
output.textContent = "PASS: WebGL 2.0 was not available when disabled.";
}
window.addEventListener("load", run, false);
</script>
<div id="output1"></div>
<div id="output2"></div>