Chromium Code Reviews| Index: LayoutTests/inspector/console/console-filter-level-test.html |
| diff --git a/LayoutTests/inspector/console/console-filter-level-test.html b/LayoutTests/inspector/console/console-filter-level-test.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e84701123bc6b2e4e5411e13dbb0076f3fe22c29 |
| --- /dev/null |
| +++ b/LayoutTests/inspector/console/console-filter-level-test.html |
| @@ -0,0 +1,98 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/console-test.js"></script> |
| +<script src="resources/log-source.js"></script> |
| +<script> |
| +// Create a mix of log messages from different source files |
| +function onload() |
| +{ |
| + console.info("sample info"); |
| + console.log("sample log"); |
| + console.warn("sample warning"); |
| + console.debug("sample debug"); |
| + console.error("sample error"); |
| + |
| + console.info("abc info"); |
| + console.info("def info"); |
| + |
| + console.warn("abc warn"); |
| + console.warn("def warn"); |
| + |
| + |
|
vsevik
2013/12/06 08:48:44
nit: extra line
Dmitry Zvorygin
2013/12/06 10:02:59
Done.
|
| + runTest(); |
| +} |
| + |
| +function test() |
| +{ |
| + var messagesElement = WebInspector.consoleView.messagesElement; |
| + |
| + function dumpVisibleMessages() |
| + { |
| + var children = WebInspector.consoleView.topGroup.element.childNodes[0].childNodes; |
| + |
| + for (var i = 0; i < children.length; i++) |
| + InspectorTest.addResult(">" + children[i].textContent); |
| + } |
| + |
| + var testSuite = [ |
| + function beforeFilter(next) |
| + { |
| + InspectorTest.addResult(arguments.callee.name); |
| + dumpVisibleMessages(); |
| + next(); |
| + }, |
|
vsevik
2013/12/06 08:48:44
nit: blank line between functions
Dmitry Zvorygin
2013/12/06 10:02:59
Done.
|
| + function onlyWarning(next) |
| + { |
| + WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("warning"); |
| + dumpVisibleMessages(); |
| + next(); |
| + }, |
| + function onlyLog(next) |
| + { |
| + WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("log"); |
| + dumpVisibleMessages(); |
| + next(); |
| + }, |
| + function onlyErrorDebug(next) |
| + { |
| + WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("error"); |
| + WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("debug", true); |
| + dumpVisibleMessages(); |
| + next(); |
| + }, |
| + function onlyAbcMessagePlain(next) |
| + { |
| + WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter(WebInspector.NamedBitSetFilterUI.ALL_TYPES); |
| + WebInspector.consoleView._filter._textFilterUI.setValue("abc"); |
| + dumpVisibleMessages(); |
| + next(); |
| + }, |
| + function onlyAbcMessageRegex(next) |
| + { |
| + WebInspector.consoleView._filter._textFilterUI._regexCheckBox.checked = "checked"; |
| + WebInspector.consoleView._filter._textFilterUI.setValue("ab[a-z]"); |
| + dumpVisibleMessages(); |
| + next(); |
| + }, |
| + function onlyAbcMessageRegexWarning(next) |
| + { |
| + WebInspector.consoleView._filter._levelFilterUI._toggleTypeFilter("warning", false); |
| + dumpVisibleMessages(); |
| + next(); |
| + } |
| + ] |
| + |
| + InspectorTest.evaluateInConsole("'Should be always visible'", InspectorTest.runTestSuite.bind(InspectorTest, testSuite)); |
| +} |
| + |
| +</script> |
| +</head> |
| + |
| +<body onload="onload()"> |
| +<p> |
| + Tests that console can filter messages by source. |
| +</p> |
| + |
| +</body> |
| +</html> |