michael@0: /* vim:set ts=2 sw=2 sts=2 et: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: const TEST_URI = 'data:text/html;charset=utf-8,
hi
'; michael@0: michael@0: function onContentLoaded() michael@0: { michael@0: browser.removeEventListener("load", onContentLoaded, true); michael@0: michael@0: let HUD = HUDService.getHudByWindow(content); michael@0: michael@0: let cssWarning = "Unknown property '-moz-opacity'. Declaration dropped."; michael@0: michael@0: waitForMessages({ michael@0: webconsole: HUD, michael@0: messages: [{ michael@0: text: cssWarning, michael@0: category: CATEGORY_CSS, michael@0: severity: SEVERITY_WARNING, michael@0: repeats: 2, michael@0: }], michael@0: }).then(testConsoleLogRepeats); michael@0: } michael@0: michael@0: function testConsoleLogRepeats() michael@0: { michael@0: let HUD = HUDService.getHudByWindow(content); michael@0: let jsterm = HUD.jsterm; michael@0: michael@0: jsterm.clearOutput(); michael@0: michael@0: jsterm.setInputValue("for (let i = 0; i < 10; ++i) console.log('this is a line of reasonably long text that I will use to verify that the repeated text node is of an appropriate size.');"); michael@0: jsterm.execute(); michael@0: michael@0: waitForMessages({ michael@0: webconsole: HUD, michael@0: messages: [{ michael@0: text: "this is a line of reasonably long text", michael@0: category: CATEGORY_WEBDEV, michael@0: severity: SEVERITY_LOG, michael@0: repeats: 10, michael@0: }], michael@0: }).then(finishTest); michael@0: } michael@0: michael@0: /** michael@0: * Unit test for bug 611795: michael@0: * Repeated CSS messages get collapsed into one. michael@0: */ michael@0: function test() michael@0: { michael@0: addTab(TEST_URI); michael@0: browser.addEventListener("load", function onLoad() { michael@0: browser.removeEventListener("load", onLoad, true); michael@0: openConsole(null, function(aHud) { michael@0: // Clear cached messages that are shown once the Web Console opens. michael@0: aHud.jsterm.clearOutput(true); michael@0: browser.addEventListener("load", onContentLoaded, true); michael@0: content.location.reload(); michael@0: }); michael@0: }, true); michael@0: }