dom/tests/mochitest/general/test_bug629535.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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>

mercurial