editor/libeditor/base/tests/test_bug567213.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=567213
     5 -->
     7 <head>
     8   <title>Test for Bug 567213</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    12 </head>
    14 <body>
    15   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=567213">Mozilla Bug 567213</a>
    16   <p id="display"></p>
    17   <div id="content">
    18     <div id="target" contenteditable="true">test</div>
    19     <button id="thief">theif</button>
    20   </div>
    22   <pre id="test">
    23     <script type="application/javascript">
    25       /** Test for Bug 567213 **/
    27       SimpleTest.waitForExplicitFinish();
    29       addLoadEvent(function() {
    30         var target = document.getElementById("target");
    31         var thief = document.getElementById("thief");
    32         var sel = window.getSelection();
    34         // select the contents of the editable area
    35         sel.removeAllRanges();
    36         sel.selectAllChildren(target);
    37         target.focus();
    39         // press some key
    40         synthesizeKey("X", {});
    41         is(target.textContent, "X", "Text input should work (sanity check)");
    43         // select the contents of the editable area again
    44         sel.removeAllRanges();
    45         sel.selectAllChildren(target);
    46         thief.focus();
    48         // press some key with the thief having focus
    49         synthesizeKey("Y", {});
    50         is(target.textContent, "X", "Text entry should not work with another element focused");
    52         SimpleTest.finish();
    53       });
    55    </script>
    56   </pre>
    57 </body>
    58 </html>

mercurial