michael@0: /* vim: set ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() michael@0: { michael@0: waitForExplicitFinish(); michael@0: michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: gBrowser.selectedBrowser.addEventListener("load", function onLoad() { michael@0: gBrowser.selectedBrowser.removeEventListener("load", onLoad, true); michael@0: openScratchpad(runTests); michael@0: }, true); michael@0: michael@0: content.location = "data:text/html;charset=utf8,

test long string in Scratchpad

"; michael@0: } michael@0: michael@0: function runTests() michael@0: { michael@0: let sp = gScratchpadWindow.Scratchpad; michael@0: michael@0: sp.setText("'0'.repeat(10000)"); michael@0: michael@0: sp.display().then(() => { michael@0: is(sp.getText(), "'0'.repeat(10000)\n" + michael@0: "/*\n" + "0".repeat(10000) + "\n*/", michael@0: "display()ing a long string works"); michael@0: finish(); michael@0: }); michael@0: }