editor/libeditor/html/tests/test_bug966552.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=966552
     5 -->
     6 <head>
     7   <title>Test for Bug 966552</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    11 </head>
    12 <body>
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=966552">Mozilla Bug 966552</a>
    14 <p id="display"></p>
    15 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    19 SimpleTest.waitForExplicitFinish();
    21 addLoadEvent(function() {
    22   var win = window.open("data:text/html,<body onload=\"document.designMode='on'\">test</body>", "", "test-966552");
    23   win.addEventListener("load", function onLoad() {
    24     win.removeEventListener("load", onLoad);
    25     runTest(win);
    26   }, false);
    27 });
    29 function runTest(win) {
    30   SimpleTest.waitForFocus(function() {
    31     var doc = win.document;
    32     var sel = win.getSelection();
    33     doc.body.focus();
    34     sel.collapse(doc.body.firstChild, 2);
    35     synthesizeKey("VK_BACK_SPACE", {ctrlKey: true}, win);
    36     is(doc.body.textContent, "st");
    37     win.close();
    38     SimpleTest.finish();
    39   }, win);
    40 }
    42 </script>
    43 </pre>
    44 </body>
    45 </html>

mercurial