browser/devtools/webconsole/test/browser_cached_messages.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 sw=2 sts=2 et: */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 // Test to see if the cached messages are displayed when the console UI is opened.
michael@0 7
michael@0 8 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-webconsole-error-observer.html";
michael@0 9
michael@0 10 function test()
michael@0 11 {
michael@0 12 waitForExplicitFinish();
michael@0 13
michael@0 14 expectUncaughtException();
michael@0 15
michael@0 16 addTab(TEST_URI);
michael@0 17 gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
michael@0 18 gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
michael@0 19 testOpenUI(true);
michael@0 20 }, true);
michael@0 21 }
michael@0 22
michael@0 23 function testOpenUI(aTestReopen)
michael@0 24 {
michael@0 25 openConsole(null, function(hud) {
michael@0 26 waitForMessages({
michael@0 27 webconsole: hud,
michael@0 28 messages: [
michael@0 29 {
michael@0 30 text: "log Bazzle",
michael@0 31 category: CATEGORY_WEBDEV,
michael@0 32 severity: SEVERITY_LOG,
michael@0 33 },
michael@0 34 {
michael@0 35 text: "error Bazzle",
michael@0 36 category: CATEGORY_WEBDEV,
michael@0 37 severity: SEVERITY_ERROR,
michael@0 38 },
michael@0 39 {
michael@0 40 text: "bazBug611032",
michael@0 41 category: CATEGORY_JS,
michael@0 42 severity: SEVERITY_ERROR,
michael@0 43 },
michael@0 44 {
michael@0 45 text: "cssColorBug611032",
michael@0 46 category: CATEGORY_CSS,
michael@0 47 severity: SEVERITY_WARNING,
michael@0 48 },
michael@0 49 ],
michael@0 50 }).then(() => {
michael@0 51 closeConsole(gBrowser.selectedTab, function() {
michael@0 52 aTestReopen && info("will reopen the Web Console");
michael@0 53 executeSoon(aTestReopen ? testOpenUI : finishTest);
michael@0 54 });
michael@0 55 });
michael@0 56 });
michael@0 57 }

mercurial