editor/libeditor/html/tests/test_bug629845.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=629845
     5 -->
     6 <head>
     7   <title>Test for Bug 629845</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/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=629845">Mozilla Bug 629845</a>
    14 <p id="display"></p>
    16 <script>
    17 function initFrame(frame)
    18 {
    19   frame.contentWindow.document.designMode="on";
    20   frame.contentWindow.document.writeln("<body></body>");
    22   document.getElementsByTagName('button')[0].click();
    23 }
    25 function command(aName)
    26 {
    27   var frame = document.getElementsByTagName('iframe')[0];
    29   is(frame.contentDocument.designMode, "on", "design mode should be on!");
    30   var caught = false;
    31   try {
    32     frame.contentDocument.execCommand(aName, false, null);
    33   } catch (e) {
    34     ok(false, "exception " + e + " was thrown");
    35     caught = true;
    36   }
    38   ok(!caught, "No exception should have been thrown.");
    40   // Stop the document load before finishing, just to be clean.
    41   document.getElementsByTagName('iframe')[0].contentWindow.document.close();
    42   SimpleTest.finish();
    43 }
    44 </script>
    46 <div id="content">
    47   <button type="button" onclick="command('bold');">Bold</button>
    48   <iframe onload="initFrame(this);"></iframe>
    49 </div>
    50 <pre id="test">
    51 <script type="application/javascript">
    53 /** Test for Bug 629845 **/
    55 SimpleTest.waitForExplicitFinish();
    57 </script>
    58 </pre>
    59 </body>
    60 </html>

mercurial