dom/xbl/test/test_bug946815.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/xbl/test/test_bug946815.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,38 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=946815
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 946815</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +  <script type="application/javascript">
    1.15 +
    1.16 +  SimpleTest.waitForExplicitFinish();
    1.17 +
    1.18 +  function setup() {
    1.19 +    // The idea of this test is to test the visibility of window.MozWifiP2pManager
    1.20 +    // which requires 'wifi-manage' permission on content/XBL respectively.
    1.21 +    // We start from no 'wifi-manage' permission, so window.MozWifiP2pManager
    1.22 +    // is supposed to not be seen on both content and XBL scope. Then we add
    1.23 +    // the permission back and we should see window.MozWifiP2pManager on content
    1.24 +    // and XBL scope.
    1.25 +    SpecialPowers.pushPermissions([{ "type": "wifi-manage", "allow": 0, "context": window.document }], function() {
    1.26 +      $('ifr').setAttribute('src', 'file_bug946815.xhtml');
    1.27 +    });
    1.28 +  }
    1.29 +
    1.30 +  </script>
    1.31 +</head>
    1.32 +<body onload="setup();">
    1.33 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=946815">Mozilla Bug 946815</a>
    1.34 +<p id="display"></p>
    1.35 +<div id="content">
    1.36 +<iframe id="ifr"></iframe>
    1.37 +</div>
    1.38 +<pre id="test">
    1.39 +</pre>
    1.40 +</body>
    1.41 +</html>

mercurial