file_lock_orientation_with_pending_fullscreen.html (706B)
1 <!DOCTYPE html> 2 <head> 3 <meta charset="utf-8"> 4 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> 5 </head> 6 <script> 7 const ok = window.parent.ok; 8 const SpecialPowers = window.parent.SpecialPowers; 9 10 async function runTest() { 11 SpecialPowers.wrap(document.documentElement).requestFullscreen(); 12 const currentType = window.screen.orientation.type; 13 const lockPromise = window.screen.orientation.lock(currentType.startsWith("landscape") ? "portrait" : "landscape"); 14 ok(true, "lock orientation doesn't throw error at this time"); 15 // This document will be detached by "pending" message. 16 parent.postMessage("pending", "*"); 17 await lockPromise; 18 } 19 </script> 20 <body onload="runTest()"> 21 </body> 22 </html>