vertical-scroll-main-frame-manual.tentative.html (1386B)
1 <!DOCTYPE html> 2 <title>Ensure 'vertical-scroll' does not affect main frame</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/permissions-policy/experimental-features/resources/common.js"></script> 6 <script src="/permissions-policy/experimental-features/resources/vertical-scroll.js"></script> 7 <style> 8 html, body { 9 height: 100%; 10 width: 100%; 11 } 12 .spacer { 13 width: 100%; 14 height: 100%; 15 margin-top: 100%; 16 margin-bottom: 100%; 17 } 18 </style> 19 <p> Making sure there is room for vertical scroll </p> 20 <div class="spacer"></div> 21 <div class="spacer"></div> 22 </p>EOP</p> 23 <script> 24 "use strict"; 25 26 // Sanity check. 27 test(() => { 28 assert_false(document.featurePolicy.allowsFeature("vertical-scroll"), 29 "Expected 'vertical-scroll' to be disabled."); 30 }, "'vertical-scroll' disabled in main document."); 31 32 // Wait for the helper scripts to load. 33 promise_test(async() => { 34 if (window.input_api_ready) 35 return Promise.resolve(); 36 await new Promise( (r) => { 37 window.resolve_on_input_api_ready = r; 38 }); 39 }, "Make sure input injection API is ready."); 40 41 promise_test(async() => { 42 window.scrollTo(0, 0); 43 await inject_input("down"); 44 assert_greater_than(window.scrollY, 0, "Page must have scrolled down."); 45 }, "Verify that the page scrolls vertically."); 46 </script>