|
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 type="application/javascript" 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 SpecialPowers.setBoolPref("full-screen-api.enabled", true); |
|
17 |
|
18 var gPrevTrusted = SpecialPowers.getBoolPref("full-screen-api.allow-trusted-requests-only"); |
|
19 SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", false); |
|
20 |
|
21 const Cc = Components.classes; |
|
22 const Ci = Components.interfaces; |
|
23 |
|
24 function make_uri(url) { |
|
25 var ios = Cc["@mozilla.org/network/io-service;1"]. |
|
26 getService(Ci.nsIIOService); |
|
27 return ios.newURI(url, null, null); |
|
28 } |
|
29 |
|
30 // Ensure "fullscreen" permissions are not present on the test URI. |
|
31 var pm = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsIPermissionManager); |
|
32 var uri = make_uri("http://mochi.test:8888"); |
|
33 var principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"] |
|
34 .getService(Ci.nsIScriptSecurityManager) |
|
35 .getNoAppCodebasePrincipal(uri); |
|
36 pm.removeFromPrincipal(principal, "fullscreen"); |
|
37 |
|
38 newwindow = window.open("MozEnteredDomFullscreen_chrome.xul", "_blank","chrome,resizable=yes,width=400,height=400"); |
|
39 |
|
40 function done() |
|
41 { |
|
42 newwindow.close(); |
|
43 SpecialPowers.setBoolPref("full-screen-api.enabled", gPrevEnabled); |
|
44 SpecialPowers.setBoolPref("full-screen-api.allow-trusted-requests-only", gPrevTrusted); |
|
45 SimpleTest.finish(); |
|
46 } |
|
47 |
|
48 </script> |
|
49 |
|
50 <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/> |
|
51 |
|
52 </window> |