browser/devtools/scratchpad/test/browser_scratchpad_long_string.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 /* vim: set ts=2 et sw=2 tw=80: */
     2 /* Any copyright is dedicated to the Public Domain.
     3    http://creativecommons.org/publicdomain/zero/1.0/ */
     5 function test()
     6 {
     7   waitForExplicitFinish();
     9   gBrowser.selectedTab = gBrowser.addTab();
    10   gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
    11     gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
    12     openScratchpad(runTests);
    13   }, true);
    15   content.location = "data:text/html;charset=utf8,<p>test long string in Scratchpad</p>";
    16 }
    18 function runTests()
    19 {
    20   let sp = gScratchpadWindow.Scratchpad;
    22   sp.setText("'0'.repeat(10000)");
    24   sp.display().then(() => {
    25     is(sp.getText(), "'0'.repeat(10000)\n" +
    26                      "/*\n" + "0".repeat(10000) + "\n*/",
    27        "display()ing a long string works");
    28     finish();
    29   });
    30 }

mercurial