test_adapter_enabled.html (686B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <script src="/tests/SimpleTest/SimpleTest.js"></script> 6 <link rel="stylesheet" href="/tests/SimpleTest/test.css" /> 7 </head> 8 <body> 9 <script> 10 const func = async function () { 11 var gotException = false; 12 try { 13 await navigator.gpu.requestAdapter(); 14 } catch (ex) { 15 gotException = true; 16 } 17 ok(!gotException, "requesting an adapter should not throw"); 18 }; 19 20 SimpleTest.waitForExplicitFinish(); 21 func() 22 .catch(e => ok(false, "Unhandled exception " + e)) 23 .finally(() => SimpleTest.finish()); 24 </script> 25 </body> 26 </html>