test_MozDomFullscreen_event.xhtml (1671B)
1 <?xml version="1.0"?> 2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> 3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?> 4 <!-- 5 Test that "MozShowFullScreenWarning" is dispatched to chrome on restricted keypress. 6 --> 7 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="400" height="400"> 8 9 <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 10 11 <script> 12 SimpleTest.waitForExplicitFinish(); 13 14 // Ensure the full-screen api is enabled, and will be disabled on test exit. 15 var gPrevEnabled = SpecialPowers.getBoolPref("full-screen-api.enabled"); 16 var gPrevTrusted = SpecialPowers.getBoolPref("full-screen-api.allow-trusted-requests-only"); 17 var newwindow; 18 19 // Ensure "fullscreen" permissions are not present on the test URI. 20 var uri = Services.io.newURI("https://example.com"); 21 var principal = Services.scriptSecurityManager.createContentPrincipal(uri, {}); 22 Services.perms.removeFromPrincipal(principal, "fullscreen"); 23 24 SpecialPowers.pushPrefEnv({"set": [ 25 ['full-screen-api.enabled', true], 26 ['full-screen-api.allow-trusted-requests-only', false], 27 ['full-screen-api.transition-duration.enter', '0 0'], 28 ['full-screen-api.transition-duration.leave', '0 0'] 29 ]}).then(setup); 30 31 function setup() { 32 newwindow = window.browsingContext.topChromeWindow.openDialog( 33 "MozDomFullscreen_chrome.xhtml", "_blank","chrome,dialog=no,resizable=yes,width=400,height=400", window); 34 } 35 36 function done() 37 { 38 newwindow.close(); 39 SimpleTest.finish(); 40 } 41 42 </script> 43 44 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> 45 46 </window>