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=629535
5 -->
6 <head>
7 <title>Test for Bug 629535</title>
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
10 </head>
11 <body>
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=629535">Mozilla Bug 629535</a>
14 <script type="application/javascript">
16 const dntPref = 'privacy.donottrackheader.enabled';
18 SimpleTest.waitForExplicitFinish();
20 is(SpecialPowers.getBoolPref(dntPref), false,
21 'DNT should be disabled by default');
22 is(navigator.doNotTrack, 'unspecified',
23 'navigator.doNotTrack should initially be "unspecified".');
25 SpecialPowers.pushPrefEnv({"clear": [[dntPref]]}, test1);
27 function test1() {
28 is(navigator.doNotTrack, "unspecified", 'after clearing pref');
29 SpecialPowers.pushPrefEnv({"set": [[dntPref, true]]}, test2);
30 }
32 function test2() {
33 is(navigator.doNotTrack, "yes", 'after setting pref to true');
34 SpecialPowers.pushPrefEnv({"set": [[dntPref, false]]}, test3);
35 }
37 function test3() {
38 is(navigator.doNotTrack, "unspecified", 'after setting pref to false');
39 SimpleTest.finish();
40 }
42 </script>
44 </body>
45 </html>