editor/libeditor/base/tests/test_bug586662.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=586662
     5 -->
     7 <head>
     8   <title>Test for Bug 586662</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=586662">Mozilla Bug 586662</a>
    16   <p id="display"><textarea onkeypress="this.style.overflow = 'hidden'"></textarea></p>
    17   <div id="content" style="display: none">
    18   </div>
    20   <pre id="test">
    21     <script type="application/javascript">
    23 SimpleTest.waitForExplicitFinish();
    24 SimpleTest.waitForFocus(function() {
    25   var t = document.querySelector("textarea");
    26   t.focus();
    27   synthesizeKey("a", {});
    28   is(getComputedStyle(t, null).overflow, "hidden", "The event handler should be executed");
    29   is(t.value, "a", "The key entry should result in a character being added to the field");
    31   var win = window.open("file_bug586662.html", "_blank",
    32                         "width=600,height=600,scrollbars=yes");
    33   SimpleTest.waitForFocus(function() {
    34     // Make sure that focusing the textarea will cause the page to scroll
    35     var ed = win.document.getElementById("editor");
    36     ed.focus();
    37     setTimeout(function() {
    38       isnot(win.scrollY, 0, "Page is scrolled down");
    39       // Scroll back up
    40       win.scrollTo(0, 0);
    41       setTimeout(function() {
    42         is(win.scrollY, 0, "Page is scrolled back up");
    43         // Make sure that typing something into the textarea will cause the
    44         // page to scroll down
    45         synthesizeKey("a", {}, win);
    46         setTimeout(function() {
    47           isnot(win.scrollY, 0, "Page is scrolled down again");
    49           win.close();
    50           SimpleTest.finish();
    51         }, 0);
    52       }, 0);
    53     }, 0);
    54   }, win);
    55 });
    57    </script>
    58   </pre>
    59 </body>
    60 </html>

mercurial