screen-orientation-lock.https.html (820B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/speculation-rules/prerender/resources/utils.js"></script> 5 <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> 6 <script> 7 8 const params = new URLSearchParams(location.search); 9 10 // The main test page (restriction-screen-orientation-lock.https.html) loads the 11 // initiator page, then the initiator page will prerender itself with the 12 // `prerendering` parameter. 13 const isPrerendering = params.has('prerendering'); 14 15 if (!isPrerendering) { 16 loadInitiatorPage(); 17 } else { 18 const prerenderEventCollector = new PrerenderEventCollector(); 19 prerenderEventCollector.start( 20 screen.orientation.lock('portrait'), 'screen.orientation.lock'); 21 } 22 23 </script>