summaryrefslogtreecommitdiff
path: root/browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
committerMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
commit81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch)
tree6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js
parent28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff)
downloadpalemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js')
-rw-r--r--browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js101
1 files changed, 0 insertions, 101 deletions
diff --git a/browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js b/browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js
deleted file mode 100644
index aeb73c58e..000000000
--- a/browser/devtools/webconsole/test/browser_webconsole_console_logging_api.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Tests that the basic console.log()-style APIs and filtering work.
-
-"use strict";
-
-const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
-
-let test = asyncTest(function*() {
- yield loadTab(TEST_URI);
- let hud = yield openConsole();
- hud.jsterm.clearOutput();
-
- let outputNode = hud.outputNode;
-
- let methods = ["log", "info", "warn", "error", "exception", "debug"];
- for (let method of methods) {
- yield testMethod(method, hud, outputNode);
- }
-});
-
-function* testMethod(aMethod, aHud, aOutputNode) {
- let console = content.console;
-
- aHud.jsterm.clearOutput();
-
- console[aMethod]("foo-bar-baz");
- console[aMethod]("baar-baz");
-
- yield waitForMessages({
- webconsole: aHud,
- messages: [{
- text: "foo-bar-baz",
- }, {
- text: "baar-baz",
- }],
- });
-
- setStringFilter("foo", aHud);
-
- is(aOutputNode.querySelectorAll(".filtered-by-string").length, 1,
- "1 hidden " + aMethod + " node via string filtering")
-
- aHud.jsterm.clearOutput();
-
- // now toggle the current method off - make sure no visible message
- // TODO: move all filtering tests into a separate test file: see bug 608135
-
- console[aMethod]("foo-bar-baz");
- yield waitForMessages({
- webconsole: aHud,
- messages: [{
- text: "foo-bar-baz",
- }],
- });
-
- setStringFilter("", aHud);
- let filter;
- switch(aMethod) {
- case "debug":
- filter = "log";
- break;
- case "exception":
- filter = "error";
- break;
- default:
- filter = aMethod;
- break;
- }
-
- aHud.setFilterState(filter, false);
-
- is(aOutputNode.querySelectorAll(".filtered-by-type").length, 1,
- "1 message hidden for " + aMethod + " (logging turned off)")
-
- aHud.setFilterState(filter, true);
-
- is(aOutputNode.querySelectorAll(".message:not(.filtered-by-type)").length, 1,
- "1 message shown for " + aMethod + " (logging turned on)")
-
- aHud.jsterm.clearOutput();
-
- // test for multiple arguments.
- console[aMethod]("foo", "bar");
-
- yield waitForMessages({
- webconsole: aHud,
- messages: [{
- text: '"foo" "bar"',
- category: CATEGORY_WEBDEV,
- }],
- })
-}
-
-function setStringFilter(aValue, aHud) {
- aHud.ui.filterBox.value = aValue;
- aHud.ui.adjustVisibilityOnSearchStringChange();
-}