browser/devtools/scratchpad/test/browser_scratchpad_long_string.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/scratchpad/test/browser_scratchpad_long_string.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +/* vim: set ts=2 et sw=2 tw=80: */
     1.5 +/* Any copyright is dedicated to the Public Domain.
     1.6 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.7 +
     1.8 +function test()
     1.9 +{
    1.10 +  waitForExplicitFinish();
    1.11 +
    1.12 +  gBrowser.selectedTab = gBrowser.addTab();
    1.13 +  gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
    1.14 +    gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
    1.15 +    openScratchpad(runTests);
    1.16 +  }, true);
    1.17 +
    1.18 +  content.location = "data:text/html;charset=utf8,<p>test long string in Scratchpad</p>";
    1.19 +}
    1.20 +
    1.21 +function runTests()
    1.22 +{
    1.23 +  let sp = gScratchpadWindow.Scratchpad;
    1.24 +
    1.25 +  sp.setText("'0'.repeat(10000)");
    1.26 +
    1.27 +  sp.display().then(() => {
    1.28 +    is(sp.getText(), "'0'.repeat(10000)\n" +
    1.29 +                     "/*\n" + "0".repeat(10000) + "\n*/",
    1.30 +       "display()ing a long string works");
    1.31 +    finish();
    1.32 +  });
    1.33 +}

mercurial