test_navigator_gpu_not_replaceable.html (941B)
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 ok( 11 SpecialPowers.getBoolPref("dom.webgpu.enabled"), 12 "Pref should be enabled." 13 ); 14 const originalNavigatorGpu = navigator.gpu; 15 16 const BAD_GPU_VAL = "ohcrapthisisbad"; 17 ok( 18 navigator.gpu !== BAD_GPU_VAL, 19 "`navigator.gpu` should never equal `BAD_GPU_VAL` (before replacement attempt)" 20 ); 21 navigator.gpu = BAD_GPU_VAL; 22 ok( 23 navigator.gpu !== BAD_GPU_VAL, 24 "`navigator.gpu` should never equal `BAD_GPU_VAL` (after replacement attempt)" 25 ); 26 ok( 27 navigator.gpu === originalNavigatorGpu, 28 "`navigator.gpu` should equal originally observed value after attempted replacement" 29 ); 30 </script> 31 </body> 32 </html>