blob: 17ea42b1b257201554f8aab845c51e97eff03702 [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.setWebGPUEnabled(true);
var ctx = getContext("webgpu");
if (ctx)
output.textContent = "PASS: WebGPU was available when enabled.";
else
output.textContent = "FAIL: WebGPU was not available when enabled.";
output = document.getElementById("output2");
window.internals.settings.setWebGPUEnabled(false);
var ctx = getContext("webgpu");
if (ctx)
output.textContent = "FAIL: WebGPU was available when disabled.";
else
output.textContent = "PASS: WebGPU was not available when disabled.";
}
window.addEventListener("load", run, false);
</script>
<div id="output1"></div>
<div id="output2"></div>