test_bug1847329.html (1258B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src="/tests/SimpleTest/SimpleTest.js"></script> 5 <script src="/tests/SimpleTest/EventUtils.js"></script> 6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 7 </head> 8 9 <script> 10 // this is a crashtest, just getting to the end is a pass, fullscreen 11 // doesn't work in crashtests though not sure why, also not working in 12 // wpt crashtests --> 13 SimpleTest.waitForExplicitFinish(); 14 15 SimpleTest.requestFlakyTimeout("crashtest sensitive to timing"); 16 17 function begin() { 18 SimpleTest.waitForFocus(begin2); 19 } 20 21 function begin2() { 22 SpecialPowers.pushPrefEnv({ 23 "set":[["full-screen-api.allow-trusted-requests-only", false]] 24 }, startTest); 25 } 26 27 window.addEventListener("load", begin); 28 29 async function startTest() { 30 b.requestFullscreen().catch(e => {}) 31 c.useMap = "#a" 32 c.requestFullscreen().catch(e => {}) 33 34 setTimeout(finishup, 400); 35 } 36 async function finishup() { 37 await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve))); 38 try { 39 await document.exitFullscreen(); 40 } catch (ex) { 41 } 42 ok(true, "finished"); 43 SimpleTest.finish(); 44 } 45 </script> 46 47 <map id="a"> 48 <area id="b"></area> 49 </map> 50 <image id="c"></image> 51 <button onclick="req()">click</button> 52 53 </html>