editor/libeditor/text/tests/test_bug318065.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 <!-- This Source Code Form is subject to the terms of the Mozilla Public
     3    - License, v. 2.0. If a copy of the MPL was not distributed with this
     4    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
     5 <html>
     6 <!--
     7 https://bugzilla.mozilla.org/show_bug.cgi?id=318065
     8 -->
    10 <head>
    11   <title>Test for Bug 318065</title>
    12   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    13   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    14   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>  
    15 </head>
    17 <body>
    18   <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=318065">Mozilla Bug 318065</a>
    19   <p id="display"></p>
    20   <div id="content" style="display: none">
    21   </div>
    23   <pre id="test">
    24     <script type="application/javascript">
    26       /** Test for Bug 318065 **/
    27       SimpleTest.waitForExplicitFinish();
    28       SimpleTest.waitForFocus(function() {
    29         var expectedValues = ["A", "", "A", "", "A", "", "A"];
    30         var messages = ["Initial text inserted",
    31                         "Initial text deleted",
    32                         "Undo of deletion",
    33                         "Redo of deletion",
    34                         "Initial text typed",
    35                         "Undo of typing",
    36                         "Redo of typing"];
    37         var step = 0;
    39         function onInput() {
    40           is(this.value, expectedValues[step], messages[step]);
    41           step++;
    42           if (step == expectedValues.length) {
    43             this.removeEventListener("input", onInput, false); 
    44             SimpleTest.finish();
    45           }
    46         }
    48         var input = document.getElementById("t1");
    49         input.addEventListener("input", onInput, false);
    50         var input2 = document.getElementById("t2");
    51         input2.addEventListener("input", onInput, false);
    53         input.focus();
    55         // Tests 0 + 1: Input letter and delete it again
    56         synthesizeKey("A", {});
    57         synthesizeKey("VK_BACK_SPACE", {});
    59         // Test 2: Undo deletion. Value of input should be "A"
    60         synthesizeKey("Z", {accelKey: true});
    62         // Test 3: Redo deletion. Value of input should be ""
    63         synthesizeKey("Z", {accelKey: true, shiftKey: true});
    65         input2.focus();
    67         // Test 4: Input letter
    68         synthesizeKey("A", {});
    70         // Test 5: Undo typing. Value of input should be ""
    71         synthesizeKey("Z", {accelKey: true});
    73         // Test 6: Redo typing. Value of input should be "A"
    74         synthesizeKey("Z", {accelKey: true, shiftKey: true});
    75       });
    76    </script>
    77   </pre>
    79   <input type="text" value="" id="t1" />
    80   <input type="text" value="" id="t2" />
    81 </body>
    82 </html>

mercurial