gfx/tests/mochitest/test_bug513439.html

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=513439
     5 -->
     6 <head>
     7   <title>Test for Bug 513439</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=513439">Mozilla Bug 513439</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 513439 **/
    22 var prefService = SpecialPowers.Cc["@mozilla.org/preferences-service;1"]
    23                                .getService(SpecialPowers.Ci.nsIPrefService);
    24 var layoutCSSBranch = prefService.getBranch("layout.css.");
    25 var oldVal = layoutCSSBranch.getCharPref("devPixelsPerPx");
    27 try {
    28   var domWindowUtils = SpecialPowers.DOMWindowUtils;
    29   var devPxPerCSSPx = domWindowUtils.screenPixelsPerCSSPixel;
    31   layoutCSSBranch.setCharPref("devPixelsPerPx", "2");
    32   is(domWindowUtils.screenPixelsPerCSSPixel, 2, "devPixelsPerPx wasn't set correctly");
    34   layoutCSSBranch.setCharPref("devPixelsPerPx", "1.5");
    35   is(domWindowUtils.screenPixelsPerCSSPixel, 1.5, "devPixelsPerPx wasn't set correctly");
    37 } finally {
    38   layoutCSSBranch.setCharPref("devPixelsPerPx", oldVal);
    39 }
    41 </script>
    42 </pre>
    43 </body>
    44 </html>

mercurial