browser/devtools/webconsole/test/browser_longstring_hang.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 sw=2 sts=2 et: */
     2 /* Any copyright is dedicated to the Public Domain.
     3  * http://creativecommons.org/publicdomain/zero/1.0/ */
     5 // Test that very long strings do not hang the browser.
     7 function test()
     8 {
     9   addTab("http://example.com/browser/browser/devtools/webconsole/test/test-bug-859170-longstring-hang.html");
    11   let hud = null;
    13   gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
    14     gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
    15     openConsole(null, performTest);
    16   }, true);
    18   function performTest(aHud)
    19   {
    20     hud = aHud;
    21     info("wait for the initial long string");
    23     waitForMessages({
    24       webconsole: hud,
    25       messages: [
    26         {
    27           name: "find 'foobar', no 'foobaz', in long string output",
    28           text: "foobar",
    29           noText: "foobaz",
    30           category: CATEGORY_WEBDEV,
    31           longString: true,
    32         },
    33       ],
    34     }).then(onInitialString);
    35   }
    37   function onInitialString(aResults)
    38   {
    39     let clickable = aResults[0].longStrings[0];
    40     ok(clickable, "long string ellipsis is shown");
    41     clickable.scrollIntoView(false);
    43     EventUtils.synthesizeMouse(clickable, 2, 2, {}, hud.iframeWindow);
    45     info("wait for long string expansion");
    47     waitForMessages({
    48       webconsole: hud,
    49       messages: [
    50         {
    51           name: "find 'foobaz' after expand, but no 'boom!' at the end",
    52           text: "foobaz",
    53           noText: "boom!",
    54           category: CATEGORY_WEBDEV,
    55           longString: false,
    56         },
    57         {
    58           text: "too long to be displayed",
    59           longString: false,
    60         },
    61       ],
    62     }).then(finishTest);
    63   }
    64 }

mercurial