Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 <!DOCTYPE html>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=898512
5 -->
6 <head>
7 <title>Test for Bug 898512 Settings API</title>
8 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
9 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
11 </head>
12 <body>
14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=898512">Mozilla Bug 898512</a>
15 <p id="display"></p>
16 <div id="content" style="display: none">
17 <iframe></iframe>
18 </div>
19 <pre id="test">
20 <script class="testbody" type="text/javascript;version=1.7">
22 SimpleTest.waitForExplicitFinish();
24 function testPref() {
25 SpecialPowers.pushPrefEnv({
26 set: [["dom.mozSettings.enabled", false]]
27 }, function() {
28 ise(navigator.mozSettings, undefined, "navigator.mozSettings is undefined");
29 SimpleTest.finish();
30 });
31 }
33 SpecialPowers.pushPermissions([
34 {type: "settings-read", allow: 0, context: document},
35 {type: "settings-write", allow: 0, context: document}
36 ], function() {
37 ise(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions");
38 testPref();
39 });
40 </script>
41 </pre>
42 </body>
43 </html>