browser/devtools/scratchpad/test/browser_scratchpad_long_string.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

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

mercurial