test_bug1836801.html (1846B)
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 --> 12 SimpleTest.waitForExplicitFinish(); 13 14 SimpleTest.requestFlakyTimeout("crashtest sensitive to timing"); 15 16 function begin() { 17 SimpleTest.waitForFocus(begin2); 18 } 19 20 function begin2() { 21 SpecialPowers.pushPrefEnv({ 22 "set":[["full-screen-api.allow-trusted-requests-only", false]] 23 }, startTest); 24 } 25 26 window.addEventListener("load", begin); 27 28 const func_0 = async function(arg0) { 29 //SpecialPowers.wrap(document).notifyUserGestureActivation(); 30 await arg0.originalTarget.requestFullscreen() 31 arg0.originalTarget.ariaValueText = "a" 32 } 33 34 async function startTest() { 35 let a = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas") 36 document.documentElement.appendChild(a) 37 document.addEventListener("DOMAttrModified", func_0, { }) 38 let b = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas") 39 document.documentElement.appendChild(b) 40 b.setAttribute("class", "x") 41 //SpecialPowers.wrap(document).notifyUserGestureActivation(); 42 await b.mozRequestFullScreen() 43 let c = document.createElementNS("http://www.w3.org/1999/xhtml", "slot") 44 document.documentElement.appendChild(c) 45 c.setAttribute("class", "x") 46 b.inert = true 47 setTimeout(async () => { 48 b.setAttribute("title", "a") 49 }, 200) 50 a.ariaSort = "descending" 51 setTimeout(finishup, 400); 52 } 53 async function finishup() { 54 await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve))); 55 await document.exitFullscreen(); 56 SimpleTest.finish(); 57 } 58 </script> 59 </html>