browser/devtools/scratchpad/test/browser_scratchpad_long_string.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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